diff options
author | Eike Ziller <eike.ziller@qt.io> | 2024-01-25 08:59:18 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2024-01-26 12:25:26 +0000 |
commit | acedf93ba32467a9848cebe25da35c096a5993ae (patch) | |
tree | 9940beda3e74168bab3cdde7c8dc08857940fe0c /src/plugins/modeleditor | |
parent | 34087df11e93a3624e64e4a8079f1b9af20e3d58 (diff) |
Remove CommandButton
The same can be achieve with a factory method in `Command`, similar to
the existing ones for actions and buttons which synchronize their tool
tips with the shortcut.
Change-Id: I7e17654706b902dfa14f37b958fc2a60705d5cb5
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/modeleditor')
-rw-r--r-- | src/plugins/modeleditor/modeleditor.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/plugins/modeleditor/modeleditor.cpp b/src/plugins/modeleditor/modeleditor.cpp index 0fdeb83b291..f17a35e4342 100644 --- a/src/plugins/modeleditor/modeleditor.cpp +++ b/src/plugins/modeleditor/modeleditor.cpp @@ -52,7 +52,6 @@ #include <coreplugin/icore.h> #include <coreplugin/editormanager/editormanager.h> #include <coreplugin/minisplitter.h> -#include <coreplugin/actionmanager/commandbutton.h> #include <utils/fadingindicator.h> #include <utils/fileutils.h> #include <utils/layoutbuilder.h> @@ -71,18 +70,19 @@ #include <QImageWriter> #include <QLabel> #include <QMap> +#include <QMenu> #include <QMessageBox> #include <QPainter> #include <QPixmap> #include <QScrollArea> +#include <QScrollBar> #include <QStackedWidget> #include <QStyleFactory> #include <QTimer> #include <QToolBox> +#include <QToolButton> #include <QUndoStack> #include <QVBoxLayout> -#include <QMenu> -#include <QScrollBar> #include <algorithm> @@ -297,8 +297,9 @@ void ModelEditor::init() toolbarLayout->setContentsMargins(0, 0, 0, 0); toolbarLayout->setSpacing(0); - auto openParentButton = new CommandButton(Constants::OPEN_PARENT_DIAGRAM, d->toolbar); - openParentButton->setDefaultAction(d->actionHandler->openParentDiagramAction()); + auto openParentButton + = Command::toolButtonWithAppendedShortcut(d->actionHandler->openParentDiagramAction(), + Constants::OPEN_PARENT_DIAGRAM); toolbarLayout->addWidget(openParentButton); d->diagramSelector = new QComboBox(d->toolbar); @@ -327,8 +328,9 @@ void ModelEditor::init() d->toolbar)); toolbarLayout->addSpacing(20); - auto syncToggleButton = new CommandButton(Constants::ACTION_SYNC_BROWSER, d->toolbar); - syncToggleButton->setDefaultAction(d->actionHandler->synchronizeBrowserAction()); + auto syncToggleButton + = Command::toolButtonWithAppendedShortcut(d->actionHandler->synchronizeBrowserAction(), + Constants::ACTION_SYNC_BROWSER); QMenu *syncMenu = new QMenu(syncToggleButton); QActionGroup *syncGroup = new QActionGroup(syncMenu); d->syncBrowserWithDiagramAction = syncMenu->addAction(Tr::tr("Synchronize Structure with Diagram")); |