[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 20:35:57 CEST 2009


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

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

Also, show the popup menu on press rather than release.
(cherry picked from commit 2c13ce176ca98706217450ef500f03aa2c0b9038)

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

 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 411c33a..cac087e 100644
--- a/modules/gui/qt4/util/customwidgets.hpp
+++ b/modules/gui/qt4/util/customwidgets.hpp
@@ -78,15 +78,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