forked from qt-creator/qt-creator
TextEditor: Support tooltips for buttons in text mark tooltips
In case users don't find the icon self-explanatory. Task-number: QTCREATORBUG-25150 Change-Id: I481b1ea7f510f065f83badcb91e127ac1c81f5a1 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -310,6 +310,7 @@ void TextMark::addToToolTipLayout(QGridLayout *target) const
|
||||
QTC_ASSERT(!action->icon().isNull(), continue);
|
||||
auto button = new QToolButton;
|
||||
button->setIcon(action->icon());
|
||||
button->setToolTip(action->toolTip());
|
||||
QObject::connect(button, &QToolButton::clicked, action, &QAction::triggered);
|
||||
QObject::connect(button, &QToolButton::clicked, []() {
|
||||
Utils::ToolTip::hideImmediately();
|
||||
@@ -398,6 +399,7 @@ void TextMark::setSettingsPage(Id settingsPage)
|
||||
delete m_settingsAction;
|
||||
m_settingsAction = new QAction;
|
||||
m_settingsAction->setIcon(Utils::Icons::SETTINGS_TOOLBAR.icon());
|
||||
m_settingsAction->setToolTip(tr("Show Diagnostic Settings"));
|
||||
QObject::connect(m_settingsAction, &QAction::triggered, [this, settingsPage] {
|
||||
Core::ICore::showOptionsDialog(settingsPage);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user