diff options
author | Kai Koehne <kai.koehne@nokia.com> | 2010-03-18 16:47:13 +0100 |
---|---|---|
committer | Kai Koehne <kai.koehne@nokia.com> | 2010-03-18 16:56:47 +0100 |
commit | 7d423d5f96e7e65ccfe4359094dc5c4a7e1e5de5 (patch) | |
tree | a119e8be759e68ae6e883d5fdc6b15c2c2bdafe3 /src/plugins/qmldesigner/components | |
parent | 0cb8416502c81d309d10f7f29a8a77118a0bce6e (diff) | |
download | qt-creator-7d423d5f96e7e65ccfe4359094dc5c4a7e1e5de5.tar.gz |
QmlDesigner: Fix crash in property editor when parent of an item is invalid
Happened for
import Qt 4.6
Flipable {
Rectangle {}
}
Diffstat (limited to 'src/plugins/qmldesigner/components')
-rw-r--r-- | src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp b/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp index 5c677348cf..1309adea5e 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/siblingcombobox.cpp @@ -87,19 +87,20 @@ void SiblingComboBox::setup() } QmlItemNode parent(m_itemNode.instanceParent().toQmlItemNode()); - m_itemList.prepend(parent); - QString parentString("Parent ("); - if (parent.id().isEmpty()) - parentString += parent.simplfiedTypeName(); - else - parentString += parent.id(); - parentString += ")"; - insertItem(0, parentString); + if (parent.isValid()) { + m_itemList.prepend(parent); + QString parentString("Parent ("); + if (parent.id().isEmpty()) + parentString += parent.simplfiedTypeName(); + else + parentString += parent.id(); + parentString += ")"; + insertItem(0, parentString); + } setCurrentIndex(m_itemList.indexOf(m_selectedItemNode)); connect(this, SIGNAL(currentIndexChanged (int)), this, SLOT(changeSelection(int))); - } |