[vlc-commits] Qt: show context menu on pictureflow (fix #11876)

Francois Cartegnie git at videolan.org
Tue Feb 24 18:34:21 CET 2015


vlc/vlc-2.2 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Feb 24 18:27:05 2015 +0100| [de0c5426e6f8c2ae27f9c24bc5d07d2758ca6b53] | committer: Jean-Baptiste Kempf

Qt: show context menu on pictureflow (fix #11876)

ContextMenuEvent should be forwarded to parent
when child has Qt::NoContextMenu policy.
Here, I can't figure out what is not working,
parent never fires signal, event at viewport level.

Redirecting signal as a workaound then :/
(might be pixels offset due to missing coordinates conversion)

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

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

 modules/gui/qt4/components/playlist/views.cpp |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/modules/gui/qt4/components/playlist/views.cpp b/modules/gui/qt4/components/playlist/views.cpp
index 4530660..59f6535 100644
--- a/modules/gui/qt4/components/playlist/views.cpp
+++ b/modules/gui/qt4/components/playlist/views.cpp
@@ -484,6 +484,9 @@ PicFlowView::PicFlowView( QAbstractItemModel *p_model, QWidget *parent ) : QAbst
     QHBoxLayout *layout = new QHBoxLayout( this );
     layout->setMargin( 0 );
     picFlow = new PictureFlow( this, p_model );
+    picFlow->setContextMenuPolicy( Qt::CustomContextMenu );
+    connect( picFlow, SIGNAL(customContextMenuRequested( const QPoint & )),
+             this,    SIGNAL(customContextMenuRequested( const QPoint & )) );
     layout->addWidget( picFlow );
     picFlow->setSlideSize(QSize( 4*LISTVIEW_ART_SIZE, 3*LISTVIEW_ART_SIZE) );
     setSelectionMode( QAbstractItemView::SingleSelection );



More information about the vlc-commits mailing list