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) {
|
auto handleActions = [this, &context](const QVector<Edit3DAction *> &actions, QMenu *menu, bool left) {
|
||||||
bool previousWasSeparator = true;
|
bool previousWasSeparator = true;
|
||||||
QActionGroup *group = nullptr;
|
QActionGroup *group = nullptr;
|
||||||
|
QActionGroup *proxyGroup = nullptr;
|
||||||
for (auto action : actions) {
|
for (auto action : actions) {
|
||||||
if (action) {
|
if (action) {
|
||||||
QAction *a = action->action();
|
QAction *a = action->action();
|
||||||
@@ -99,6 +100,8 @@ Edit3DWidget::Edit3DWidget(Edit3DView *view) :
|
|||||||
Core::Command *command = Core::ActionManager::registerAction(
|
Core::Command *command = Core::ActionManager::registerAction(
|
||||||
a, action->menuId().constData(), context);
|
a, action->menuId().constData(), context);
|
||||||
command->setDefaultKeySequence(a->shortcut());
|
command->setDefaultKeySequence(a->shortcut());
|
||||||
|
if (proxyGroup)
|
||||||
|
proxyGroup->addAction(command->action());
|
||||||
// Menu actions will have custom tooltips
|
// Menu actions will have custom tooltips
|
||||||
if (menu)
|
if (menu)
|
||||||
a->setToolTip(command->stringWithAppendedShortcut(a->toolTip()));
|
a->setToolTip(command->stringWithAppendedShortcut(a->toolTip()));
|
||||||
@@ -110,9 +113,11 @@ Edit3DWidget::Edit3DWidget(Edit3DView *view) :
|
|||||||
} else {
|
} else {
|
||||||
if (previousWasSeparator) {
|
if (previousWasSeparator) {
|
||||||
group = new QActionGroup(this);
|
group = new QActionGroup(this);
|
||||||
|
proxyGroup = new QActionGroup(this);
|
||||||
previousWasSeparator = false;
|
previousWasSeparator = false;
|
||||||
} else {
|
} else {
|
||||||
group = nullptr;
|
group = nullptr;
|
||||||
|
proxyGroup = nullptr;
|
||||||
auto separator = new QAction(this);
|
auto separator = new QAction(this);
|
||||||
separator->setSeparator(true);
|
separator->setSeparator(true);
|
||||||
if (menu) {
|
if (menu) {
|
||||||
|
Reference in New Issue
Block a user