]> git.sesse.net Git - vlc/commitdiff
Qt: show context menu on pictureflow (fix #11876)
authorFrancois Cartegnie <fcvlcdev@free.fr>
Tue, 24 Feb 2015 17:27:05 +0000 (18:27 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Tue, 24 Feb 2015 17:31:03 +0000 (18:31 +0100)
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)

modules/gui/qt4/components/playlist/views.cpp

index 52a150aba1b462c571d1a6909fef118e94ef8ba9..29526804d3136d53b6e86546bbac24518bc3736f 100644 (file)
@@ -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 );