summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@digia.com>2014-09-08 10:26:19 +0200
committerThomas Hartmann <Thomas.Hartmann@digia.com>2014-09-08 15:51:04 +0200
commitd31b3dcef3b6e8f705636c2554f4eb54d081a0e9 (patch)
tree837dad2bccfef1abaa1233f7fd60588c12e695b4
parent34fb3d6a5ab0f0be488a1f0a7cc17d86d66ba4e0 (diff)
downloadqt-creator-d31b3dcef3b6e8f705636c2554f4eb54d081a0e9.tar.gz
QmlDesigner.Navigator: Crash fix
Objects which are not an Item are not visible in the tree view. In this case model() is 0 and Qt Creator was crashing when detaching the navigator view. Change-Id: I144c940d76157defb27133673ed911d733d8b5ef Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
-rw-r--r--src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
index 2adba6ea7e..059d4c173a 100644
--- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
+++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp
@@ -548,8 +548,10 @@ static QList<QStandardItem*> takeWholeRow(const ItemRow &itemRow)
{
if (itemRow.idItem->parent())
return itemRow.idItem->parent()->takeRow(itemRow.idItem->row());
- else
+ else if (itemRow.idItem->model())
return itemRow.idItem->model()->takeRow(itemRow.idItem->row());
+ else
+ return itemRow.toList();
}
void NavigatorTreeModel::removeSubTree(const ModelNode &node)