From 5b5aaf9eb3d9cb835df40e4b41cf7e5ff4e299e5 Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Thu, 13 Oct 2016 11:15:15 +0200 Subject: [PATCH] QmlDesigner: Add more items to component combobox It makes sense to also add items that are not in a default properties to the component comobox. These are items like styling delegates: Slider { handle: Item { } } or the items of e.g. a Flipable: Flipable { front: Item { } Those items are not shown in the navigator (TODO) and it makes sense to edit them if they were an inline component. Change-Id: Iab5b6e0238625b5a486901fbf617911d06a34581 Reviewed-by: Tim Jenssen --- .../qmldesigner/components/integration/componentview.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/components/integration/componentview.cpp b/src/plugins/qmldesigner/components/integration/componentview.cpp index be304dd44d4..1bd29179ec8 100644 --- a/src/plugins/qmldesigner/components/integration/componentview.cpp +++ b/src/plugins/qmldesigner/components/integration/componentview.cpp @@ -191,7 +191,9 @@ void ComponentView::searchForComponentAndAddToList(const ModelNode &node) bool masterNotAdded = true; foreach (const ModelNode &node, node.allSubModelNodesAndThisNode()) { - if (node.nodeSourceType() == ModelNode::NodeWithComponentSource) { + if (node.nodeSourceType() == ModelNode::NodeWithComponentSource + || (node.hasParentProperty() + && !node.parentProperty().isDefaultProperty())) { if (masterNotAdded) { masterNotAdded = true; addMasterDocument(); @@ -200,9 +202,6 @@ void ComponentView::searchForComponentAndAddToList(const ModelNode &node) if (!hasEntryForNode(node)) { QString description = descriptionForNode(node); - - - QStandardItem *item = new QStandardItem(description); item->setData(QVariant::fromValue(node.internalId()), ModelNodeRole); item->setEditable(false);