From 8f23a4aba28dc9b878de22e9271a534dc7c94d41 Mon Sep 17 00:00:00 2001
From: Thomas Hartmann <Thomas.Hartmann@nokia.com>
Date: Tue, 23 Feb 2010 17:11:11 +0100
Subject: [PATCH] QmlDesigner.propertyEditor: fix setupPane()

---
 .../propertyeditor/propertyeditor.cpp         | 29 +++++++++++--------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
index faf3bf9c49c..dd71527afd9 100644
--- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
+++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp
@@ -235,26 +235,31 @@ PropertyEditor::~PropertyEditor()
 
 void PropertyEditor::setupPane(const QString &typeName)
 {
-    if (m_typeHash.contains(typeName))
-        return;
 
     QUrl qmlFile = fileToUrl(locateQmlFile(QLatin1String("Qt/ItemPane.qml")));
     QUrl qmlSpecificsFile;
 
     qmlSpecificsFile = fileToUrl(locateQmlFile(typeName + "Specifics.qml"));
+    NodeType *type = m_typeHash.value(qmlFile.toString());
 
-    NodeType *type = m_typeHash.value(typeName);
-
-    type = new NodeType(qmlFile, this);
+    if (!type) {
+        type = new NodeType(qmlFile, this);
 
-    m_stackedWidget->addWidget(type->m_view);
-    m_typeHash.insert(typeName, type);
+        QmlContext *ctxt = type->m_view->rootContext();
+        ctxt->setContextProperty("finishedNotify", QVariant(false) );
+        type->initialSetup(typeName, qmlSpecificsFile, this);
+        type->m_view->execute();
+        ctxt->setContextProperty("finishedNotify", QVariant(true) );
 
-    QmlContext *ctxt = type->m_view->rootContext();
-    type->initialSetup(typeName, qmlSpecificsFile, this);
-    ctxt->setContextProperty("finishedNotify", QVariant(false) );
-    type->m_view->execute();
-    ctxt->setContextProperty("finishedNotify", QVariant(true) );
+        m_stackedWidget->addWidget(type->m_view);
+        m_typeHash.insert(qmlFile.toString(), type);
+    } else {
+        QmlContext *ctxt = type->m_view->rootContext();
+        ctxt->setContextProperty("finishedNotify", QVariant(false) );
+        type->initialSetup(typeName, qmlSpecificsFile, this); 
+        ctxt->setContextProperty("finishedNotify", QVariant(true) );
+    }
+    QApplication::processEvents();
 }
 
 void PropertyEditor::changeValue(const QString &propertyName)
-- 
GitLab