Commit 421a1cf9 authored by Thomas Hartmann's avatar Thomas Hartmann Committed by Eike Ziller

QmlDesigner.contextMenu: crash fix

Task-number: QTCREATORBUG-6071
Change-Id: Iae2cc199cd8ec3809bc635084b8a8fa79bb36b08
Reviewed-on: http://codereview.qt-project.org/4643Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
parent c00ee670
......@@ -71,7 +71,7 @@ static inline bool checkIfNodeIsAView(const ModelNode &node)
static inline bool isItem(const ModelNode &node)
{
return node.metaInfo().isValid() && node.metaInfo().isSubclassOf("QtQuick.Item", -1, -1);
return node.isValid() && node.metaInfo().isValid() && node.metaInfo().isSubclassOf("QtQuick.Item", -1, -1);
}
static inline QList<QmlItemNode> siblingsForNode(const QmlItemNode &itemNode)
......@@ -251,7 +251,7 @@ void ModelNodeContextMenu::execute(const QPoint &pos, bool selectionMenuBool)
editMenu->addAction(action);
action = createModelNodeAction(tr("Visibility"), editMenu, QList<ModelNode>() << currentSingleNode, ModelNodeAction::ModelNodeVisibility, singleSelected);
editMenu->addAction(action);
if (!isItem(currentSingleNode))
if (singleSelected && !isItem(currentSingleNode))
action->setDisabled(true);
} else {
......
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