aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/resourceeditor
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2024-01-25 08:59:18 +0100
committerEike Ziller <eike.ziller@qt.io>2024-01-26 12:25:26 +0000
commitacedf93ba32467a9848cebe25da35c096a5993ae (patch)
tree9940beda3e74168bab3cdde7c8dc08857940fe0c /src/plugins/resourceeditor
parent34087df11e93a3624e64e4a8079f1b9af20e3d58 (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/resourceeditor')
-rw-r--r--src/plugins/resourceeditor/resourceeditor.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/resourceeditor/resourceeditor.cpp b/src/plugins/resourceeditor/resourceeditor.cpp
index 54ea676713..2bc7d443bc 100644
--- a/src/plugins/resourceeditor/resourceeditor.cpp
+++ b/src/plugins/resourceeditor/resourceeditor.cpp
@@ -10,7 +10,7 @@
#include "qrceditor/resourcefile_p.h"
#include <coreplugin/actionmanager/actionmanager.h>
-#include <coreplugin/actionmanager/commandbutton.h>
+#include <coreplugin/actionmanager/command.h>
#include <coreplugin/coreplugintr.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditorfactory.h>
@@ -27,6 +27,7 @@
#include <QDebug>
#include <QMenu>
#include <QToolBar>
+#include <QToolButton>
using namespace Core;
using namespace Utils;
@@ -143,8 +144,8 @@ ResourceEditorImpl::ResourceEditorImpl()
setContext(Context(Constants::C_RESOURCEEDITOR));
setWidget(m_resourceEditor);
- CommandButton *refreshButton = new CommandButton(Constants::REFRESH, m_toolBar);
- refreshButton->setIcon(QIcon(QLatin1String(":/texteditor/images/finddocuments.png")));
+ QToolButton *refreshButton = Command::createToolButtonWithShortcutToolTip(Constants::REFRESH);
+ refreshButton->defaultAction()->setIcon(QIcon(":/texteditor/images/finddocuments.png"));
connect(refreshButton, &QAbstractButton::clicked, m_resourceEditor, &QrcEditor::refresh);
m_toolBar->addWidget(refreshButton);