]> git.sur5r.net Git - minitube/commitdiff
Finally found a way to kill tooltips
authorFlavio Tordini <flavio.tordini@gmail.com>
Tue, 6 Apr 2010 16:18:03 +0000 (18:18 +0200)
committerFlavio Tordini <flavio.tordini@gmail.com>
Tue, 6 Apr 2010 16:18:03 +0000 (18:18 +0200)
src/MainWindow.cpp
src/MainWindow.h

index 0c85e5f90b7dcbf8118dac3226d0bfccb3b100a2..767aaa5b2816cfb7f5e9dd6fc038175b700ee833 100755 (executable)
@@ -46,6 +46,9 @@ MainWindow::MainWindow() :
     // restore window position
     readSettings();
     
+    // event filter to block ugly toolbar tooltips
+    qApp->installEventFilter(this);
+
     // show the initial view
     showWidget(searchView);
     
@@ -56,6 +59,16 @@ MainWindow::~MainWindow() {
     delete history;
 }
 
+bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
+    if (event->type() == QEvent::ToolTip) {
+        // kill tooltips
+        return true;
+    } else {
+        // standard event processing
+        return QObject::eventFilter(obj, event);
+    }
+}
+
 void MainWindow::createActions() {
     
     QMap<QString, QAction*> *actions = The::globalActions();
index 67bf1e2b43ecad427e11f4c08698edbcab46fa5d..bcd3a7184cd3dfb7837eaa56003dda88866f648a 100755 (executable)
@@ -26,6 +26,7 @@ public slots:
 
 protected:
     void closeEvent(QCloseEvent *);
+    bool eventFilter(QObject *obj, QEvent *event);
 
 private slots:
     void fadeInWidget(QWidget *oldWidget, QWidget *newWidget);