From ac2fb06ba0bc0b9fd8746f481428eb725d12ed2f Mon Sep 17 00:00:00 2001 From: Thomas Hartmann <Thomas.Hartmann@nokia.com> Date: Tue, 16 Feb 2010 12:46:03 +0100 Subject: [PATCH] QmlDesigner.propertyEditor: cache panes based on type Before we cached based on the main qml url - This way we skip setting up the specific widgets each time we change selection --- .../components/propertyeditor/propertyeditor.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp index 287ca5ce462..7bf47d3833a 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditor.cpp @@ -445,12 +445,19 @@ void PropertyEditor::resetView() if (m_selectedNode.isValid()) qmlSpecificsFile = fileToUrl(locateQmlFile(m_selectedNode.type() + "Specifics.qml")); - NodeType *type = m_typeHash.value(qmlFile.toString()); + QString typeString("invalid"); + + if (m_selectedNode.isValid()) { + qmlSpecificsFile = fileToUrl(locateQmlFile(m_selectedNode.type() + "Specifics.qml")); + typeString = m_selectedNode.type(); + } + + NodeType *type = m_typeHash.value(typeString); if (!type) { type = new NodeType(qmlFile, this); m_stackedWidget->addWidget(type->m_view); - m_typeHash.insert(qmlFile.toString(), type); + m_typeHash.insert(typeString, type); QmlObjectNode fxObjectNode; if (m_selectedNode.isValid()) { -- GitLab