diff options
Diffstat (limited to 'qt-ui/profilegraphics.cpp')
-rw-r--r-- | qt-ui/profilegraphics.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp index 550a5ec57..508251232 100644 --- a/qt-ui/profilegraphics.cpp +++ b/qt-ui/profilegraphics.cpp @@ -11,6 +11,7 @@ #include <QIcon> #include <QPropertyAnimation> #include <QGraphicsSceneHoverEvent> +#include <QMouseEvent> #include "../color.h" #include "../display.h" @@ -136,6 +137,16 @@ ProfileGraphicsView::ProfileGraphicsView(QWidget* parent) : QGraphicsView(parent fill_profile_color(); } +void ProfileGraphicsView::mouseMoveEvent(QMouseEvent* event) +{ + toolTip->clear(); + QList<QGraphicsItem*> items = scene()->items( mapToScene(event->pos() ), Qt::IntersectsItemShape, Qt::DescendingOrder, transform()); + Q_FOREACH(QGraphicsItem *item, items){ + if (!item->toolTip().isEmpty()) + toolTip->addToolTip(item->toolTip()); + } +} + bool ProfileGraphicsView::eventFilter(QObject* obj, QEvent* event) { // This will "Eat" the default tooltip behavior. |