Test out awful hack to try to make selection work properly.

This commit is contained in:
Teo Mrnjavac 2015-12-11 20:23:28 +01:00
parent 3fc354284a
commit f154a135d8

View File

@ -416,8 +416,10 @@ PartitionBarsView::isIndexHidden( const QModelIndex& index ) const
void void
PartitionBarsView::setSelection( const QRect& rect, QItemSelectionModel::SelectionFlags flags ) PartitionBarsView::setSelection( const QRect& rect, QItemSelectionModel::SelectionFlags flags )
{ {
cDebug() << "About to call indexAt with point" << rect.topLeft(); int x1, y1, x2, y2;
selectionModel()->setCurrentIndex( indexAt( rect.topLeft() ), flags ); rect.getCoords( &x1, &y1, &x2, &y2 );
cDebug() << "Actual click point is" << x2 << y2;
selectionModel()->setCurrentIndex( indexAt( QPoint( x2, y2 ) ), flags );
cDebug() << "selected items count:" << selectedIndexes().count(); cDebug() << "selected items count:" << selectedIndexes().count();
QStringList itemstrings; QStringList itemstrings;
foreach( const QModelIndex& ind, selectedIndexes() ) foreach( const QModelIndex& ind, selectedIndexes() )