[vlc-commits] Qt: PLViews: fix hover-ing

Francois Cartegnie git at videolan.org
Fri Jul 20 16:08:43 CEST 2012


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Jul 20 16:08:04 2012 +0200| [69432b5bd110164d99119d95957d3cfde4f2523f] | committer: Francois Cartegnie

Qt: PLViews: fix hover-ing

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

 modules/gui/qt4/components/playlist/views.cpp |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/modules/gui/qt4/components/playlist/views.cpp b/modules/gui/qt4/components/playlist/views.cpp
index d82b945..26d6b60 100644
--- a/modules/gui/qt4/components/playlist/views.cpp
+++ b/modules/gui/qt4/components/playlist/views.cpp
@@ -65,7 +65,7 @@ void AbstractPlViewItemDelegate::paintBackground(
         painter->drawRect( r );
     }
     if( option.state & QStyle::State_MouseOver )
-    {
+    { /* requires WA_hover on viewport */
         painter->setOpacity( 0.5 );
         painter->setPen( Qt::NoPen );
         painter->setBrush( option.palette.color( QPalette::Highlight ).lighter( 150 ) );
@@ -318,6 +318,7 @@ PlIconView::PlIconView( PLModel *, QWidget *parent ) : QListView( parent )
     setSelectionBehavior( QAbstractItemView::SelectRows );
     setDragEnabled(true);
     setAttribute( Qt::WA_MacShowFocusRect, false );
+    viewport()->setAttribute( Qt::WA_Hover );
     /* dropping in QListView::IconMode does not seem to work */
     //setAcceptDrops( true );
     //setDropIndicatorShown(true);
@@ -363,6 +364,7 @@ PlListView::PlListView( PLModel *, QWidget *parent ) : QListView( parent )
     PlListViewItemDelegate *delegate = new PlListViewItemDelegate( this );
     setItemDelegate( delegate );
     setAttribute( Qt::WA_MacShowFocusRect, false );
+    viewport()->setAttribute( Qt::WA_Hover );
 }
 
 void PlListView::startDrag ( Qt::DropActions supportedActions )
@@ -410,6 +412,7 @@ PlTreeView::PlTreeView( PLModel *, QWidget *parent ) : QTreeView( parent )
     setUniformRowHeights( true );
     setSortingEnabled( true );
     setAttribute( Qt::WA_MacShowFocusRect, false );
+    viewport()->setAttribute( Qt::WA_Hover );
     header()->setSortIndicator( -1 , Qt::AscendingOrder );
     header()->setSortIndicatorShown( true );
     header()->setClickable( true );



More information about the vlc-commits mailing list