Maybe don't crash.
This commit is contained in:
parent
9ecd23dfc7
commit
ea7b95e474
@ -480,7 +480,7 @@ PartitionBarsView::mouseMoveEvent( QMouseEvent* event )
|
|||||||
|
|
||||||
if ( oldHoveredIndex != m_hoveredIndex )
|
if ( oldHoveredIndex != m_hoveredIndex )
|
||||||
{
|
{
|
||||||
if ( !canBeSelected( m_hoveredIndex ) )
|
if ( m_hoveredIndex.isValid() && !canBeSelected( m_hoveredIndex ) )
|
||||||
QGuiApplication::setOverrideCursor( Qt::ForbiddenCursor );
|
QGuiApplication::setOverrideCursor( Qt::ForbiddenCursor );
|
||||||
else
|
else
|
||||||
QGuiApplication::restoreOverrideCursor();
|
QGuiApplication::restoreOverrideCursor();
|
||||||
|
@ -557,15 +557,21 @@ PartitionLabelsView::mouseMoveEvent( QMouseEvent* event )
|
|||||||
m_hoveredIndex = candidateIndex;
|
m_hoveredIndex = candidateIndex;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
m_hoveredIndex = QModelIndex();
|
m_hoveredIndex = QModelIndex();
|
||||||
|
QGuiApplication::restoreOverrideCursor();
|
||||||
|
}
|
||||||
|
|
||||||
if ( !canBeSelected( m_hoveredIndex ) )
|
if ( oldHoveredIndex != m_hoveredIndex )
|
||||||
|
{
|
||||||
|
if ( m_hoveredIndex.isValid() && !canBeSelected( m_hoveredIndex ) )
|
||||||
QGuiApplication::setOverrideCursor( Qt::ForbiddenCursor );
|
QGuiApplication::setOverrideCursor( Qt::ForbiddenCursor );
|
||||||
else
|
else
|
||||||
QGuiApplication::restoreOverrideCursor();
|
QGuiApplication::restoreOverrideCursor();
|
||||||
|
|
||||||
viewport()->repaint();
|
viewport()->repaint();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user