diff options
author | Taiane Ramos <exhora.tat@gmail.com> | 2013-11-14 23:54:35 -0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-11-15 13:26:01 +0900 |
commit | 7e859da939447031ea667bc3b293175dc842d297 (patch) | |
tree | 7d699f12f0abddd218cd18777fbde5aab536c086 /qt-ui | |
parent | 711f2ddf8cd7a4c75f609e87729d3dbf89ca60db (diff) | |
download | subsurface-7e859da939447031ea667bc3b293175dc842d297.tar.gz |
Make tooltips work in the profile toolbar
This patch enables tooltips on the profile toolbar. Tooltips were
being treated as text to be shown at notification area. Now it is
verified if the cursor was positioned over the toolbar when it
activated the event. If so, tooltip is shown normally.
Fixes #238
Signed-off-by: exhora <exhora.tat@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/profilegraphics.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index d2fa701f7..9e3db2d85 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -137,10 +137,12 @@ bool ProfileGraphicsView::eventFilter(QObject* obj, QEvent* event) return true; } - // This will "Eat" the default tooltip behavior. + // This will "Eat" the default tooltip behavior if it is not on the toolBar. if (event->type() == QEvent::GraphicsSceneHelp) { - event->ignore(); - return true; + if(!toolBarProxy->geometry().contains(mapFromGlobal(QCursor::pos()))){ + event->ignore(); + return true; + } } return QGraphicsView::eventFilter(obj, event); } @@ -383,6 +385,8 @@ void ProfileGraphicsView::addControlItems(struct dive *d) QAction *scaleAction = new QAction(QIcon(":scale"), tr("Scale"), this); QAction *rulerAction = new QAction(QIcon(":ruler"), tr("Ruler"), this); QToolBar *toolBar = new QToolBar("", 0); + rulerAction->setToolTip(tr("Show a ruler to nit pecking your dive")); + scaleAction->setToolTip(tr("Scale your dive to screen size")); toolBar->addAction(rulerAction); toolBar->addAction(scaleAction); toolBar->setOrientation(Qt::Vertical); |