16 #include <QHeaderView>
37 , mCurrentEditSelectionModel( NULL )
38 , mFeatureSelectionModel( NULL )
39 , mItemDelegate( NULL )
40 , mEditSelectionDrag( false )
42 setSelectionMode( QAbstractItemView::ExtendedSelection );
112 QPoint pos =
event->pos();
114 QModelIndex
index = indexAt( pos );
131 if ( isVisible() && updatesEnabled() )
135 viewport()->update( visualRegionForSelection( localDeselected ) | visualRegionForSelection( localSelected ) );
139 if ( currentSelection.size() == 1 )
150 QItemSelection selection;
158 QItemSelection selection;
170 foreach (
const QModelIndex
index, indexes )
178 setDirtyRegion( viewport()->rect() );
189 QPoint pos =
event->pos();
191 QModelIndex
index = indexAt( pos );
226 if ( Qt::Key_Up == event->key() || Qt::Key_Down ==
event->key() )
232 currentRow = localIndex.row();
235 QModelIndex newLocalIndex;
236 QModelIndex newIndex;
238 switch ( event->key() )
241 newLocalIndex =
mModel->
index( currentRow - 1, 0 );
243 if ( newIndex.isValid() )
246 scrollTo( newLocalIndex );
251 newLocalIndex =
mModel->
index( currentRow + 1, 0 );
253 if ( newIndex.isValid() )
256 scrollTo( newLocalIndex );
272 QItemSelectionModel::SelectionFlags command = selectionCommand( index );
273 int row = index.row();
278 if ( selectionMode() != QListView::SingleSelection
279 && command.testFlag( QItemSelectionModel::Toggle ) )
283 ? QItemSelectionModel::Deselect : QItemSelectionModel::Select;
284 command &= ~QItemSelectionModel::Toggle;
287 command |= QItemSelectionModel::Current;
290 QModelIndex tl = model()->index( qMin(
mRowAnchor, row ), 0 );
291 QModelIndex br = model()->index( qMax(
mRowAnchor, row ), model()->columnCount() - 1 );