Commit 4f5f56c8 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.ContextMenu: Fix regression



We have to create a local SelectionContext for the target node.

Change-Id: I69a490fbc154d5cc15d9ea4f40899afdbab77a7c
Reviewed-by: default avatarMarco Bubke <marco.bubke@digia.com>
parent 7894bd6a
......@@ -167,10 +167,13 @@ public:
selectionAction->setParent(menu());
parentNode = selectionContext().currentSingleSelectedNode().parentProperty().parentModelNode();
selectionContext().setTargetNode(parentNode);
selectionAction->setText(QString(QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Select parent: %1")).arg(
captionForModelNode(parentNode)));
selectionAction->setSelectionContext(selectionContext());
SelectionContext nodeSelectionContext = selectionContext();
nodeSelectionContext.setTargetNode(parentNode);
selectionAction->setSelectionContext(nodeSelectionContext);
menu()->addAction(selectionAction);
}
......@@ -182,7 +185,10 @@ public:
selectionContext().setTargetNode(node);
QString what = QString(QT_TRANSLATE_NOOP("QmlDesignerContextMenu", "Select: %1")).arg(captionForModelNode(node));
ActionTemplate *selectionAction = new ActionTemplate(what, &ModelNodeOperations::select);
selectionAction->setSelectionContext(selectionContext());
SelectionContext nodeSelectionContext = selectionContext();
nodeSelectionContext.setTargetNode(node);
selectionAction->setSelectionContext(nodeSelectionContext);
menu()->addAction(selectionAction);
}
......
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