OSDN Git Service

QmlDesigner.formEditor: do not show items from a delegate
authorThomas Hartmann <Thomas.Hartmann@nokia.com>
Tue, 28 Jun 2011 11:27:12 +0000 (13:27 +0200)
committerMarco Bubke <marco.bubke@nokia.com>
Tue, 28 Jun 2011 11:42:23 +0000 (13:42 +0200)
Items that have a custom parser or are components are not shown
in the formeditor.

Task-number: QTCREATORBUG-5228
Change-Id: I633fe35d40edd1a5b14275d67a48265313b08657
Reviewed-on: http://codereview.qt.nokia.com/830
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Marco Bubke <marco.bubke@nokia.com>
src/plugins/qmldesigner/components/formeditor/formeditorview.cpp

index 6c424c1..7e29dfb 100644 (file)
@@ -125,7 +125,8 @@ void FormEditorView::setupFormEditorItemTree(const QmlItemNode &qmlItemNode)
     m_scene->addFormEditorItem(qmlItemNode);
 
     foreach (const QmlObjectNode &nextNode, qmlItemNode.allDirectSubNodes()) //TODO instance children
-        if (QmlItemNode(nextNode).isValid())
+        //If the node has source for components/custom parsers we ignore it.
+        if (QmlItemNode(nextNode).isValid() && nextNode.modelNode().nodeSourceType() == ModelNode::NodeWithoutSource)
             setupFormEditorItemTree(nextNode.toQmlItemNode());
 }