summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@digia.com>2013-09-18 13:22:41 +0200
committerThomas Hartmann <Thomas.Hartmann@digia.com>2013-09-18 13:41:05 +0200
commit374bedfb00d623b0401e1ffdba9b07cba11d21f5 (patch)
tree60bbf2dfe6256138f53e2be3e002b82b1df5984a
parent062f6baca0dfdb0e091a63e115a5dd88d6be474d (diff)
downloadqt-creator-374bedfb00d623b0401e1ffdba9b07cba11d21f5.tar.gz
QmlDesigner.StatesEditor: create widget on demand
Otherwise the widget is created but never inserted in the widget hierarchy, if the designer was never activated. In this case the widget was not deleted. Task-number: QTCREATORBUG-10169 Change-Id: Ic86d540a7044c07e272357edafd4d2f81fd1b7a4 Reviewed-by: Marco Bubke <marco.bubke@digia.com>
-rw-r--r--src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
index a259390cd1..772875365b 100644
--- a/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
+++ b/src/plugins/qmldesigner/components/stateseditor/stateseditorview.cpp
@@ -52,7 +52,6 @@ namespace QmlDesigner {
StatesEditorView::StatesEditorView(QObject *parent) :
AbstractView(parent),
m_statesEditorModel(new StatesEditorModel(this)),
- m_statesEditorWidget(new StatesEditorWidget(this, m_statesEditorModel.data())),
m_lastIndex(-1)
{
Q_ASSERT(m_statesEditorModel);
@@ -61,6 +60,9 @@ StatesEditorView::StatesEditorView(QObject *parent) :
WidgetInfo StatesEditorView::widgetInfo()
{
+ if (!m_statesEditorWidget)
+ m_statesEditorWidget = new StatesEditorWidget(this, m_statesEditorModel.data());
+
return createWidgetInfo(m_statesEditorWidget.data(), 0, "StatesEditor", WidgetInfo::TopPane, 0, tr("States Editor"));
}