Skip to content
Snippets Groups Projects
Commit 8f23a4ab authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.propertyEditor: fix setupPane()

parent 5181f2eb
No related branches found
No related tags found
No related merge requests found
...@@ -235,26 +235,31 @@ PropertyEditor::~PropertyEditor() ...@@ -235,26 +235,31 @@ PropertyEditor::~PropertyEditor()
void PropertyEditor::setupPane(const QString &typeName) void PropertyEditor::setupPane(const QString &typeName)
{ {
if (m_typeHash.contains(typeName))
return;
QUrl qmlFile = fileToUrl(locateQmlFile(QLatin1String("Qt/ItemPane.qml"))); QUrl qmlFile = fileToUrl(locateQmlFile(QLatin1String("Qt/ItemPane.qml")));
QUrl qmlSpecificsFile; QUrl qmlSpecificsFile;
qmlSpecificsFile = fileToUrl(locateQmlFile(typeName + "Specifics.qml")); qmlSpecificsFile = fileToUrl(locateQmlFile(typeName + "Specifics.qml"));
NodeType *type = m_typeHash.value(qmlFile.toString());
NodeType *type = m_typeHash.value(typeName); if (!type) {
type = new NodeType(qmlFile, this);
type = new NodeType(qmlFile, this);
m_stackedWidget->addWidget(type->m_view); QmlContext *ctxt = type->m_view->rootContext();
m_typeHash.insert(typeName, type); 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(); m_stackedWidget->addWidget(type->m_view);
type->initialSetup(typeName, qmlSpecificsFile, this); m_typeHash.insert(qmlFile.toString(), type);
ctxt->setContextProperty("finishedNotify", QVariant(false) ); } else {
type->m_view->execute(); QmlContext *ctxt = type->m_view->rootContext();
ctxt->setContextProperty("finishedNotify", QVariant(true) ); ctxt->setContextProperty("finishedNotify", QVariant(false) );
type->initialSetup(typeName, qmlSpecificsFile, this);
ctxt->setContextProperty("finishedNotify", QVariant(true) );
}
QApplication::processEvents();
} }
void PropertyEditor::changeValue(const QString &propertyName) void PropertyEditor::changeValue(const QString &propertyName)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment