18 #include <QHeaderView>
36 , mCurrentEditSelectionModel( NULL )
37 , mFeatureSelectionModel( NULL )
38 , mItemDelegate( NULL )
39 , mEditSelectionDrag( false )
41 setSelectionMode( QAbstractItemView::ExtendedSelection );
101 QPoint pos =
event->pos();
103 QModelIndex index = indexAt( pos );
120 if ( isVisible() && updatesEnabled() )
124 viewport()->update( visualRegionForSelection( localDeselected ) | visualRegionForSelection( localSelected ) );
128 if ( currentSelection.size() == 1 )
139 QItemSelection selection;
147 QItemSelection selection;
159 foreach (
const QModelIndex index, indexes )
167 setDirtyRegion( viewport()->rect() );
178 QPoint pos =
event->pos();
180 QModelIndex index = indexAt( pos );
215 if ( Qt::Key_Up == event->key() || Qt::Key_Down ==
event->key() )
221 currentRow = localIndex.row();
224 QModelIndex newLocalIndex;
225 QModelIndex newIndex;
227 switch ( event->key() )
230 newLocalIndex =
mModel->
index( currentRow - 1, 0 );
232 if ( newIndex.isValid() )
235 scrollTo( newLocalIndex );
240 newLocalIndex =
mModel->
index( currentRow + 1, 0 );
242 if ( newIndex.isValid() )
245 scrollTo( newLocalIndex );
261 QItemSelectionModel::SelectionFlags command = selectionCommand( index );
262 int row = index.row();
267 if ( selectionMode() != QListView::SingleSelection
268 && command.testFlag( QItemSelectionModel::Toggle ) )
272 ? QItemSelectionModel::Deselect : QItemSelectionModel::Select;
273 command &= ~QItemSelectionModel::Toggle;
276 command |= QItemSelectionModel::Current;
279 QModelIndex tl = model()->index( qMin(
mRowAnchor, row ), 0 );
280 QModelIndex br = model()->index( qMax(
mRowAnchor, row ), model()->columnCount() - 1 );