forked from qt-creator/qt-creator
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 <tim.jenssen@qt.io>
This commit is contained in:
committed by
Tim Jenssen
parent
e05cb92cea
commit
5b5aaf9eb3
@@ -191,7 +191,9 @@ void ComponentView::searchForComponentAndAddToList(const ModelNode &node)
|
|||||||
bool masterNotAdded = true;
|
bool masterNotAdded = true;
|
||||||
|
|
||||||
foreach (const ModelNode &node, node.allSubModelNodesAndThisNode()) {
|
foreach (const ModelNode &node, node.allSubModelNodesAndThisNode()) {
|
||||||
if (node.nodeSourceType() == ModelNode::NodeWithComponentSource) {
|
if (node.nodeSourceType() == ModelNode::NodeWithComponentSource
|
||||||
|
|| (node.hasParentProperty()
|
||||||
|
&& !node.parentProperty().isDefaultProperty())) {
|
||||||
if (masterNotAdded) {
|
if (masterNotAdded) {
|
||||||
masterNotAdded = true;
|
masterNotAdded = true;
|
||||||
addMasterDocument();
|
addMasterDocument();
|
||||||
@@ -200,9 +202,6 @@ void ComponentView::searchForComponentAndAddToList(const ModelNode &node)
|
|||||||
if (!hasEntryForNode(node)) {
|
if (!hasEntryForNode(node)) {
|
||||||
QString description = descriptionForNode(node);
|
QString description = descriptionForNode(node);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QStandardItem *item = new QStandardItem(description);
|
QStandardItem *item = new QStandardItem(description);
|
||||||
item->setData(QVariant::fromValue(node.internalId()), ModelNodeRole);
|
item->setData(QVariant::fromValue(node.internalId()), ModelNodeRole);
|
||||||
item->setEditable(false);
|
item->setEditable(false);
|
||||||
|
Reference in New Issue
Block a user