QmlDesigner: Use is valid functons instead of create a invalid node

Change-Id: I5f7cdcede593cdce2c577315ccead95e8841870e
Reviewed-by: Tim Jenssen <tim.jenssen@digia.com>
This commit is contained in:
Marco Bubke
2013-07-24 15:58:51 +02:00
parent 07147a3283
commit 599b72a24a
16 changed files with 253 additions and 244 deletions

View File

@@ -139,8 +139,9 @@ void ComponentView::searchForComponentAndAddToList(const ModelNode &node)
m_standardItemModel->appendRow(item);
} else {
QString description;
ModelNode parentNode = node.parentProperty().parentModelNode();
if (parentNode.isValid()) {
if (node.hasParentProperty()) {
ModelNode parentNode = node.parentProperty().parentModelNode();
if (parentNode.id().isEmpty())
description = parentNode.simplifiedTypeName() + QLatin1Char(' ');
else