Commit 7d423d5f authored by Kai Koehne's avatar Kai Koehne
Browse files

QmlDesigner: Fix crash in property editor when parent of an item is invalid

Happened for

import Qt 4.6
Flipable {
  Rectangle {}
}
parent 0cb84165
...@@ -87,19 +87,20 @@ void SiblingComboBox::setup() ...@@ -87,19 +87,20 @@ void SiblingComboBox::setup()
} }
QmlItemNode parent(m_itemNode.instanceParent().toQmlItemNode()); QmlItemNode parent(m_itemNode.instanceParent().toQmlItemNode());
m_itemList.prepend(parent);
QString parentString("Parent (");
if (parent.id().isEmpty()) if (parent.isValid()) {
parentString += parent.simplfiedTypeName(); m_itemList.prepend(parent);
else QString parentString("Parent (");
parentString += parent.id();
parentString += ")";
insertItem(0, parentString);
if (parent.id().isEmpty())
parentString += parent.simplfiedTypeName();
else
parentString += parent.id();
parentString += ")";
insertItem(0, parentString);
}
setCurrentIndex(m_itemList.indexOf(m_selectedItemNode)); setCurrentIndex(m_itemList.indexOf(m_selectedItemNode));
connect(this, SIGNAL(currentIndexChanged (int)), this, SLOT(changeSelection(int))); connect(this, SIGNAL(currentIndexChanged (int)), this, SLOT(changeSelection(int)));
} }
......
import Qt 4.6
Rectangle {
width: 640
height: 480
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment