forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#include "haskellmanager.h"
|
||||
#include "haskelltr.h"
|
||||
|
||||
#include <coreplugin/actionmanager/commandbutton.h>
|
||||
#include <coreplugin/actionmanager/command.h>
|
||||
#include <coreplugin/coreplugintr.h>
|
||||
|
||||
#include <texteditor/textdocument.h>
|
||||
@@ -23,8 +23,8 @@ namespace Haskell::Internal {
|
||||
static QWidget *createEditorWidget()
|
||||
{
|
||||
auto widget = new TextEditorWidget;
|
||||
auto ghciButton = new Core::CommandButton(Constants::A_RUN_GHCI, widget);
|
||||
ghciButton->setText(Tr::tr("GHCi"));
|
||||
auto ghciButton = Core::Command::createToolButtonWithShortcutToolTip(Constants::A_RUN_GHCI);
|
||||
ghciButton->defaultAction()->setIconText(Tr::tr("GHCi"));
|
||||
QObject::connect(ghciButton, &QToolButton::clicked, widget, [widget] {
|
||||
openGhci(widget->textDocument()->filePath());
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user