diff --git a/src/modules/partition/gui/PartitionBarsView.cpp b/src/modules/partition/gui/PartitionBarsView.cpp index 2599a1c8f..423a8020a 100644 --- a/src/modules/partition/gui/PartitionBarsView.cpp +++ b/src/modules/partition/gui/PartitionBarsView.cpp @@ -477,6 +477,17 @@ PartitionBarsView::leaveEvent( QEvent* event ) } +void +PartitionBarsView::mousePressEvent( QMouseEvent* event ) +{ + QModelIndex candidateIndex = indexAt( event->pos() ); + if ( canBeSelected( candidateIndex ) ) + QAbstractItemView::mousePressEvent( event ); + else + event->accept(); +} + + void PartitionBarsView::updateGeometries() { diff --git a/src/modules/partition/gui/PartitionBarsView.h b/src/modules/partition/gui/PartitionBarsView.h index f8c5fd71d..3d6937093 100644 --- a/src/modules/partition/gui/PartitionBarsView.h +++ b/src/modules/partition/gui/PartitionBarsView.h @@ -64,6 +64,7 @@ protected: void mouseMoveEvent( QMouseEvent* event ) override; void leaveEvent( QEvent* event ) override; + void mousePressEvent( QMouseEvent* event ) override; protected slots: void updateGeometries() override;