Only paint selection and hover if selectionMode is not NoSelection.
This commit is contained in:
parent
2f35aa1258
commit
fecb50779a
@ -124,7 +124,8 @@ PartitionBarsView::drawSection( QPainter* painter, const QRect& rect_, int x, in
|
|||||||
rect.adjust( 0, 0, -1, -1 );
|
rect.adjust( 0, 0, -1, -1 );
|
||||||
|
|
||||||
|
|
||||||
if ( m_hoveredIndex.isValid() &&
|
if ( selectionMode() != QAbstractItemView::NoSelection && // no hover without selection
|
||||||
|
m_hoveredIndex.isValid() &&
|
||||||
index == m_hoveredIndex )
|
index == m_hoveredIndex )
|
||||||
{
|
{
|
||||||
painter->setBrush( color.lighter( 115 ) );
|
painter->setBrush( color.lighter( 115 ) );
|
||||||
@ -155,7 +156,8 @@ PartitionBarsView::drawSection( QPainter* painter, const QRect& rect_, int x, in
|
|||||||
painter->setBrush( gradient );
|
painter->setBrush( gradient );
|
||||||
painter->drawRoundedRect( rect, radius, radius );
|
painter->drawRoundedRect( rect, radius, radius );
|
||||||
|
|
||||||
if ( index.isValid() &&
|
if ( selectionMode() != QAbstractItemView::NoSelection &&
|
||||||
|
index.isValid() &&
|
||||||
selectionModel() &&
|
selectionModel() &&
|
||||||
!selectionModel()->selectedIndexes().isEmpty() &&
|
!selectionModel()->selectedIndexes().isEmpty() &&
|
||||||
selectionModel()->selectedIndexes().first() == index )
|
selectionModel()->selectedIndexes().first() == index )
|
||||||
|
Loading…
Reference in New Issue
Block a user