From fef99d1db6507e90e4e5c896fd348a0c70748533 Mon Sep 17 00:00:00 2001 From: Flavio Tordini Date: Mon, 2 Nov 2009 21:21:46 +0100 Subject: [PATCH] Clear status tip onmouse leave event --- src/thlibrary/thblackbar.cpp | 6 ++++++ src/thlibrary/thblackbar.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/thlibrary/thblackbar.cpp b/src/thlibrary/thblackbar.cpp index dce936c..ae2c564 100644 --- a/src/thlibrary/thblackbar.cpp +++ b/src/thlibrary/thblackbar.cpp @@ -145,6 +145,12 @@ void THBlackBar::mousePressEvent (QMouseEvent *event) { } } +void THBlackBar::leaveEvent(QEvent *event) { + // status tip + QMainWindow* mainWindow = dynamic_cast(qApp->topLevelWidgets().first()); + if (mainWindow) mainWindow->statusBar()->clearMessage(); +} + QAction *THBlackBar::hoveredAction (const QPoint& pos) const { if (pos.y() <= 0 || pos.y() >= height()) return(NULL); diff --git a/src/thlibrary/thblackbar.h b/src/thlibrary/thblackbar.h index ec0ff11..4695780 100644 --- a/src/thlibrary/thblackbar.h +++ b/src/thlibrary/thblackbar.h @@ -24,6 +24,7 @@ class THBlackBar : public QWidget { void mouseMoveEvent (QMouseEvent *event); void mousePressEvent (QMouseEvent *event); + void leaveEvent(QEvent *event); private: void drawUnselectedButton ( QPainter *painter, -- 2.39.5