last one.

On Wed, Feb 5, 2014 at 4:01 PM, Tomaz Canabrava <[email protected]> wrote:

> I'm gonna be irooon like a lioooon in zioooon.
>
>
From b68ac2d70a6bb442b53753855bc357e951310886 Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <[email protected]>
Date: Wed, 5 Feb 2014 16:15:59 -0200
Subject: [PATCH 6/6] Added a event filter to hide normal tooltips

This patch adds a Event Filter to hide normal tooltips
on the new profile. All tooltips should be displayed on the
Notification Area.

Signed-off-by: Tomaz Canabrava <[email protected]>
---
 qt-ui/profile/profilewidget2.cpp | 12 +++++++++++-
 qt-ui/profile/profilewidget2.h   |  1 +
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp
index 3f215ee..2808cdc 100644
--- a/qt-ui/profile/profilewidget2.cpp
+++ b/qt-ui/profile/profilewidget2.cpp
@@ -351,7 +351,7 @@ ProfileWidget2::ProfileWidget2(QWidget *parent) :
 
 	// Starting the transitions:
 	stateMachine->start();
-
+	scene()->installEventFilter(this);
 #ifndef QT_NO_DEBUG
 	QTableView *diveDepthTableView = new QTableView();
 	diveDepthTableView->setModel(dataModel);
@@ -540,3 +540,13 @@ void ProfileWidget2::mouseMoveEvent(QMouseEvent* event)
 	}
 }
 
+bool ProfileWidget2::eventFilter(QObject *object, QEvent *event)
+{
+	QGraphicsScene *s = qobject_cast<QGraphicsScene*>(object);
+	if (s && event->type() == QEvent::GraphicsSceneHelp){
+		event->ignore();
+		return true;
+	}
+	return QGraphicsView::eventFilter(object, event);
+}
+
diff --git a/qt-ui/profile/profilewidget2.h b/qt-ui/profile/profilewidget2.h
index 2b0cf05..d2fbb2b 100644
--- a/qt-ui/profile/profilewidget2.h
+++ b/qt-ui/profile/profilewidget2.h
@@ -51,6 +51,7 @@ public:
 
 	ProfileWidget2(QWidget *parent);
 	void plotDives(QList<dive*> dives);
+	virtual bool eventFilter(QObject*, QEvent*);
 
 public slots: // Necessary to call from QAction's signals.
 	void settingsChanged();
-- 
1.8.5.3

_______________________________________________
subsurface mailing list
[email protected]
http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to