forked from qt-creator/qt-creator
Add index and filter combo box to external help window
Change-Id: Icc815379220c55d9d7dc5d154278ba21ce2e9984 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
@@ -34,11 +34,11 @@
|
||||
|
||||
#include <utils/hostosinfo.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QTextStream>
|
||||
|
||||
#include <QAction>
|
||||
#include <QShortcut>
|
||||
#include <QToolButton>
|
||||
#include <QTextStream>
|
||||
|
||||
|
||||
/*!
|
||||
\class Core::Command
|
||||
@@ -425,3 +425,20 @@ bool Action::hasAttribute(Command::CommandAttribute attr) const
|
||||
{
|
||||
return (m_attributes & attr);
|
||||
}
|
||||
|
||||
|
||||
QToolButton *Command::toolButtonWithAppendedShortcut(QAction *action, Command *cmd)
|
||||
{
|
||||
QToolButton *button = new QToolButton;
|
||||
button->setDefaultAction(action);
|
||||
if (cmd) {
|
||||
action->setToolTip(cmd->stringWithAppendedShortcut(action->text()));
|
||||
QObject::connect(cmd, &Core::Command::keySequenceChanged, action, [cmd, action]() {
|
||||
action->setToolTip(cmd->stringWithAppendedShortcut(action->text()));
|
||||
});
|
||||
QObject::connect(action, &QAction::changed, cmd, [cmd, action]() {
|
||||
action->setToolTip(cmd->stringWithAppendedShortcut(action->text()));
|
||||
});
|
||||
}
|
||||
return button;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user