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:
Eike Ziller
2014-10-01 17:52:57 +02:00
committed by Eike Ziller
parent 286dd71a5d
commit 3c59cdd031
16 changed files with 276 additions and 152 deletions

View File

@@ -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;
}