[vlc-devel] commit: A mouse click in an empty position clear the selection (see #1956) (Ludovic Fauvet )

git version control git at videolan.org
Thu Oct 16 23:42:19 CEST 2008


vlc | branch: 0.9-bugfix | Ludovic Fauvet <etix at l0cal.com> | Thu Oct 16 23:34:35 2008 +0200| [ec1e808708d2d496caa315512341020fd6d1c2c6] | committer: Jean-Baptiste Kempf 

A mouse click in an empty position clear the selection (see #1956)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 256ec29cf0ccafee497ed161449ccfe7178e0b11)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ec1e808708d2d496caa315512341020fd6d1c2c6
---

 modules/gui/qt4/util/customwidgets.hpp |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/modules/gui/qt4/util/customwidgets.hpp b/modules/gui/qt4/util/customwidgets.hpp
index 24bc324..411c33a 100644
--- a/modules/gui/qt4/util/customwidgets.hpp
+++ b/modules/gui/qt4/util/customwidgets.hpp
@@ -75,7 +75,7 @@ public:
     };
     virtual ~QVLCTreeView()   {};
 
-    void mouseReleaseEvent(QMouseEvent* e )
+    void mouseReleaseEvent( QMouseEvent* e )
     {
         if( e->button() & Qt::RightButton )
         {
@@ -84,6 +84,16 @@ public:
         }
         QTreeView::mouseReleaseEvent( e );
     }
+
+    void mousePressEvent( QMouseEvent* e )
+    {
+        if( e->button() & Qt::LeftButton )
+        {
+            if( !indexAt( QPoint( e->x(), e->y() ) ).isValid() )
+                clearSelection();
+        }
+        QTreeView::mousePressEvent( e );
+    }
 signals:
     void rightClicked( QModelIndex, QPoint  );
 };




More information about the vlc-devel mailing list