9 : QItemSelectionModel( model, parent )
10 , mFeatureModel( featureModel )
11 , mSyncEnabled( true )
12 , mClearAndSelectBuffer( false )
62 foreach (
const QModelIndex
index, selection.indexes() )
71 if ( command.testFlag( QItemSelectionModel::ClearAndSelect ) )
89 else if ( command.testFlag( QItemSelectionModel::Select ) )
106 else if ( command.testFlag( QItemSelectionModel::Deselect ) )
126 QModelIndexList updatedIndexes;
127 foreach ( QModelIndex idx, selection.indexes() )
144 if ( clearAndSelect )
150 QModelIndexList updatedIndexes;
167 QModelIndexList indexes;
168 const QAbstractItemModel* model = index.model();
169 int row = index.row();
174 for (
int column = 0; column < model->columnCount(); ++column )
176 indexes.append( model->index( row, column ) );
QgsFeatureIds mDeselectedBuffer
If sync is disabled Holds a list of newly deselected features which will be synced when re-enabled...
virtual bool isSelected(QgsFeatureId fid)
Returns the selection status of a given feature id.
virtual const QgsFeatureIds & selectedFeaturesIds() const =0
Return reference to identifiers of selected features.
QSet< QgsFeatureId > QgsFeatureIds
virtual void setSelectedFeatures(const QgsFeatureIds &ids)=0
Change selection to the new set of features.
void enableSync(bool enable)
Enables or disables synchronisation to the QgsVectorLayer When synchronisation is disabled...
virtual QModelIndex fidToIndex(QgsFeatureId fid)=0
virtual void deselect(const QgsFeatureIds &ids)=0
Deselect features.
void requestRepaint()
Request a repaint of the visible items of connected views.
virtual void selectFeatures(const QItemSelection &selection, SelectionFlags command)
Select features on this table.
virtual void setFeatureSelectionManager(QgsIFeatureSelectionManager *featureSelectionManager)
QgsIFeatureSelectionManager * mFeatureSelectionManager
virtual void layerSelectionChanged(QgsFeatureIds selected, QgsFeatureIds deselected, bool clearAndSelect)
QgsFeatureSelectionModel(QAbstractItemModel *model, QgsFeatureModel *featureModel, QgsIFeatureSelectionManager *featureSelectionHandler, QObject *parent)
Is an interface class to abstract feature selection handling.
QgsFeatureIds mSelectedBuffer
If sync is disabled Holds a list of newly selected features which will be synced when re-enabled...
bool mClearAndSelectBuffer
If sync is disabled Is set to true, if a clear and select operation should be performed before syncin...
virtual void select(const QgsFeatureIds &ids)=0
Select features.
QgsFeatureModel * mFeatureModel
QModelIndexList expandIndexToRow(const QModelIndex &index) const