[vlc-devel] commit: Qt4: activate playlist item on right click (fix #2749) ( Rémi Denis-Courmont )

git version control git at videolan.org
Sat May 23 11:43:52 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu May 21 21:32:02 2009 +0300| [2c13ce176ca98706217450ef500f03aa2c0b9038] | committer: Rémi Denis-Courmont 

Qt4: activate playlist item on right click (fix #2749)

Also, show the popup menu on press rather than release.

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

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

diff --git a/modules/gui/qt4/util/customwidgets.hpp b/modules/gui/qt4/util/customwidgets.hpp
index d1f1f74..ea5b330 100644
--- a/modules/gui/qt4/util/customwidgets.hpp
+++ b/modules/gui/qt4/util/customwidgets.hpp
@@ -93,15 +93,18 @@ public:
     void mouseReleaseEvent( QMouseEvent* e )
     {
         if( e->button() & Qt::RightButton )
-        {
-            emit rightClicked( indexAt( QPoint( e->x(), e->y() ) ),
-                               QCursor::pos() );
-        }
+            return; /* Do NOT forward to QTreeView!! */
         QTreeView::mouseReleaseEvent( e );
     }
 
     void mousePressEvent( QMouseEvent* e )
     {
+        if( e->button() & Qt::RightButton )
+        {
+            emit rightClicked( indexAt( QPoint( e->x(), e->y() ) ),
+                               QCursor::pos() );
+            return;
+        }
         if( e->button() & Qt::LeftButton )
         {
             if( !indexAt( QPoint( e->x(), e->y() ) ).isValid() )




More information about the vlc-devel mailing list