From 55c52e654a82e6c390b9becbc9c22c5429eff63c Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 13 Jan 2016 14:50:08 +0100 Subject: [PATCH] Try to force a repaint on selection changed. --- src/modules/partition/gui/PartitionLabelsView.cpp | 11 +++++++++++ src/modules/partition/gui/PartitionLabelsView.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/modules/partition/gui/PartitionLabelsView.cpp b/src/modules/partition/gui/PartitionLabelsView.cpp index a57bbb894..e3a2b2b1d 100644 --- a/src/modules/partition/gui/PartitionLabelsView.cpp +++ b/src/modules/partition/gui/PartitionLabelsView.cpp @@ -494,6 +494,17 @@ PartitionLabelsView::setCustomNewRootLabel( const QString& text ) } +void +PartitionLabelsView::setSelectionModel( QItemSelectionModel* selectionModel ) +{ + connect( selectionModel, &QItemSelectionModel::selectionChanged, + this, [=] + { + viewport()->repaint(); + } ); +} + + QModelIndex PartitionLabelsView::moveCursor( CursorAction cursorAction, Qt::KeyboardModifiers modifiers ) { diff --git a/src/modules/partition/gui/PartitionLabelsView.h b/src/modules/partition/gui/PartitionLabelsView.h index 163a2d575..3cfe35335 100644 --- a/src/modules/partition/gui/PartitionLabelsView.h +++ b/src/modules/partition/gui/PartitionLabelsView.h @@ -49,6 +49,8 @@ public: void setCustomNewRootLabel( const QString& text ); + void setSelectionModel( QItemSelectionModel* selectionModel ) override; + protected: // QAbstractItemView API QRegion visualRegionForSelection( const QItemSelection& selection ) const override;