Pop-up action's tooltip if ActionGroup is expanded and the mouse hovers over an action.

This commit is contained in:
Markus Lampert
2017-09-19 21:12:26 -07:00
committed by wmayer
parent 1c9223d300
commit bad543e114
2 changed files with 9 additions and 0 deletions

View File

@@ -45,6 +45,7 @@
#include "FileDialog.h"
#include "MainWindow.h"
#include "WhatsThis.h"
#include "Widgets.h"
#include "Workbench.h"
#include "WorkbenchManager.h"
@@ -209,6 +210,7 @@ ActionGroup::ActionGroup ( Command* pcCmd,QObject * parent)
{
_group = new QActionGroup(this);
connect(_group, SIGNAL(triggered(QAction*)), this, SLOT(onActivated (QAction*)));
connect(_group, SIGNAL(hovered(QAction*)), this, SLOT(onHovered(QAction*)));
}
ActionGroup::~ActionGroup()
@@ -350,6 +352,12 @@ void ActionGroup::onActivated (QAction* a)
_pcCmd->invoke(index);
}
void ActionGroup::onHovered (QAction *a)
{
Gui::ToolTip::showText(QCursor::pos(), a->toolTip());
}
// --------------------------------------------------------------------
namespace Gui {

View File

@@ -114,6 +114,7 @@ public Q_SLOTS:
void onActivated ();
void onActivated (int);
void onActivated (QAction*);
void onHovered (QAction*);
protected:
QActionGroup* _group;