From 927767c6452c613589a06d4509f89a3912ddec8a Mon Sep 17 00:00:00 2001 From: Thomas Hartmann Date: Fri, 20 Nov 2015 15:08:51 +0100 Subject: [PATCH] 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 Reviewed-by: Tim Jenssen --- .../qmldesigner/components/navigator/navigatortreemodel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp index 5abbc6169d2..1e345f306f5 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp @@ -565,7 +565,8 @@ static void appendNodeToEndOfTheRow(const ModelNode &modelNode, const ItemRow &n parentPropertyItem->appendRow(newItemRow.toList()); } else { QStandardItem *parentDefaultPropertyItem = parentRow.idItem; - parentDefaultPropertyItem->appendRow(newItemRow.toList()); + if (parentDefaultPropertyItem) + parentDefaultPropertyItem->appendRow(newItemRow.toList()); } } else { // root node treeModel->appendRow(newItemRow.toList());