forked from qt-creator/qt-creator
Allow designeractions to target specific views
This is needed for the "connect signal to event dialog" which resides in a different plugin but needs to be opened from the connection editor. Change-Id: I9e200791831fa46d65e5f833e14a0d893fc29432 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -172,6 +172,16 @@ void ConnectionViewWidget::contextMenuEvent(QContextMenuEvent *event)
|
||||
m_connectionEditor->updateWindowName();
|
||||
});
|
||||
|
||||
QMap<QString, QVariant> data;
|
||||
data["ModelNode"] = index.siblingAtColumn(ConnectionModel::TargetModelNodeRow).data();
|
||||
data["Signal"] = index.siblingAtColumn(ConnectionModel::TargetPropertyNameRow).data();
|
||||
DesignerActionManager &designerActionManager = QmlDesignerPlugin::instance()->designerActionManager();
|
||||
for (auto actionInterface : designerActionManager.actionsForTarget(ActionInterface::Target::ConnectionEditor)) {
|
||||
auto *action = actionInterface->action();
|
||||
action->setData(data);
|
||||
menu.addAction(action);
|
||||
}
|
||||
|
||||
menu.exec(event->globalPos());
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user