forked from qt-creator/qt-creator
QmlDesigner: Group also proxy actions of commands in Edit3DWidget
This fixes exclusion handling when actions are triggered via shortcuts. Fixes: QDS-6301 Change-Id: Iedfaaed0c2f7d534fa77743a6daa093e334d001d Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -79,6 +79,7 @@ Edit3DWidget::Edit3DWidget(Edit3DView *view) :
|
||||
auto handleActions = [this, &context](const QVector<Edit3DAction *> &actions, QMenu *menu, bool left) {
|
||||
bool previousWasSeparator = true;
|
||||
QActionGroup *group = nullptr;
|
||||
QActionGroup *proxyGroup = nullptr;
|
||||
for (auto action : actions) {
|
||||
if (action) {
|
||||
QAction *a = action->action();
|
||||
@@ -99,6 +100,8 @@ Edit3DWidget::Edit3DWidget(Edit3DView *view) :
|
||||
Core::Command *command = Core::ActionManager::registerAction(
|
||||
a, action->menuId().constData(), context);
|
||||
command->setDefaultKeySequence(a->shortcut());
|
||||
if (proxyGroup)
|
||||
proxyGroup->addAction(command->action());
|
||||
// Menu actions will have custom tooltips
|
||||
if (menu)
|
||||
a->setToolTip(command->stringWithAppendedShortcut(a->toolTip()));
|
||||
@@ -110,9 +113,11 @@ Edit3DWidget::Edit3DWidget(Edit3DView *view) :
|
||||
} else {
|
||||
if (previousWasSeparator) {
|
||||
group = new QActionGroup(this);
|
||||
proxyGroup = new QActionGroup(this);
|
||||
previousWasSeparator = false;
|
||||
} else {
|
||||
group = nullptr;
|
||||
proxyGroup = nullptr;
|
||||
auto separator = new QAction(this);
|
||||
separator->setSeparator(true);
|
||||
if (menu) {
|
||||
|
Reference in New Issue
Block a user