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

git version control git at videolan.org
Thu May 21 22:25:39 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu May 21 21:32:02 2009 +0300| [65f71aed6c3e81116d3687b61336b90a0d085792] | 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=65f71aed6c3e81116d3687b61336b90a0d085792
---

 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