diff --git a/src/Gui/Action.cpp b/src/Gui/Action.cpp index 20951fb724..0f9df4d35a 100644 --- a/src/Gui/Action.cpp +++ b/src/Gui/Action.cpp @@ -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 { diff --git a/src/Gui/Action.h b/src/Gui/Action.h index c323dac35c..893a9febab 100644 --- a/src/Gui/Action.h +++ b/src/Gui/Action.h @@ -114,6 +114,7 @@ public Q_SLOTS: void onActivated (); void onActivated (int); void onActivated (QAction*); + void onHovered (QAction*); protected: QActionGroup* _group;