Commit 69432b5b authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: PLViews: fix hover-ing

parent c3581f43
...@@ -65,7 +65,7 @@ void AbstractPlViewItemDelegate::paintBackground( ...@@ -65,7 +65,7 @@ void AbstractPlViewItemDelegate::paintBackground(
painter->drawRect( r ); painter->drawRect( r );
} }
if( option.state & QStyle::State_MouseOver ) if( option.state & QStyle::State_MouseOver )
{ { /* requires WA_hover on viewport */
painter->setOpacity( 0.5 ); painter->setOpacity( 0.5 );
painter->setPen( Qt::NoPen ); painter->setPen( Qt::NoPen );
painter->setBrush( option.palette.color( QPalette::Highlight ).lighter( 150 ) ); painter->setBrush( option.palette.color( QPalette::Highlight ).lighter( 150 ) );
...@@ -318,6 +318,7 @@ PlIconView::PlIconView( PLModel *, QWidget *parent ) : QListView( parent ) ...@@ -318,6 +318,7 @@ PlIconView::PlIconView( PLModel *, QWidget *parent ) : QListView( parent )
setSelectionBehavior( QAbstractItemView::SelectRows ); setSelectionBehavior( QAbstractItemView::SelectRows );
setDragEnabled(true); setDragEnabled(true);
setAttribute( Qt::WA_MacShowFocusRect, false ); setAttribute( Qt::WA_MacShowFocusRect, false );
viewport()->setAttribute( Qt::WA_Hover );
/* dropping in QListView::IconMode does not seem to work */ /* dropping in QListView::IconMode does not seem to work */
//setAcceptDrops( true ); //setAcceptDrops( true );
//setDropIndicatorShown(true); //setDropIndicatorShown(true);
...@@ -363,6 +364,7 @@ PlListView::PlListView( PLModel *, QWidget *parent ) : QListView( parent ) ...@@ -363,6 +364,7 @@ PlListView::PlListView( PLModel *, QWidget *parent ) : QListView( parent )
PlListViewItemDelegate *delegate = new PlListViewItemDelegate( this ); PlListViewItemDelegate *delegate = new PlListViewItemDelegate( this );
setItemDelegate( delegate ); setItemDelegate( delegate );
setAttribute( Qt::WA_MacShowFocusRect, false ); setAttribute( Qt::WA_MacShowFocusRect, false );
viewport()->setAttribute( Qt::WA_Hover );
} }
void PlListView::startDrag ( Qt::DropActions supportedActions ) void PlListView::startDrag ( Qt::DropActions supportedActions )
...@@ -410,6 +412,7 @@ PlTreeView::PlTreeView( PLModel *, QWidget *parent ) : QTreeView( parent ) ...@@ -410,6 +412,7 @@ PlTreeView::PlTreeView( PLModel *, QWidget *parent ) : QTreeView( parent )
setUniformRowHeights( true ); setUniformRowHeights( true );
setSortingEnabled( true ); setSortingEnabled( true );
setAttribute( Qt::WA_MacShowFocusRect, false ); setAttribute( Qt::WA_MacShowFocusRect, false );
viewport()->setAttribute( Qt::WA_Hover );
header()->setSortIndicator( -1 , Qt::AscendingOrder ); header()->setSortIndicator( -1 , Qt::AscendingOrder );
header()->setSortIndicatorShown( true ); header()->setSortIndicatorShown( true );
header()->setClickable( true ); header()->setClickable( true );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment