QmlDesigner: Fix crash

We removed support for non default properties in the navigator.
But the model still allows QML code like this:  toolBar: ToolBar {...}

In this case ToolBar is not visible in the navigator. But the ToolBar
is available/visible in the form editor. Reparenting anything to ToolBar did
crash. Eventually we have to re enable non default properties, but this
patch only fixes the crash.

Task-number: QTCREATORBUG-15111
Change-Id: Ifa037975c99762fb8067afffa118332044842d7f
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
Thomas Hartmann
2015-11-20 15:08:51 +01:00
committed by Tim Jenssen
parent 02e387f5d8
commit 927767c645

View File

@@ -565,6 +565,7 @@ static void appendNodeToEndOfTheRow(const ModelNode &modelNode, const ItemRow &n
parentPropertyItem->appendRow(newItemRow.toList()); parentPropertyItem->appendRow(newItemRow.toList());
} else { } else {
QStandardItem *parentDefaultPropertyItem = parentRow.idItem; QStandardItem *parentDefaultPropertyItem = parentRow.idItem;
if (parentDefaultPropertyItem)
parentDefaultPropertyItem->appendRow(newItemRow.toList()); parentDefaultPropertyItem->appendRow(newItemRow.toList());
} }
} else { // root node } else { // root node