8 : QItemSelectionModel( model, parent )
9 , 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() )
137 if ( clearAndSelect )
143 QModelIndexList updatedIndexes;
160 QModelIndexList indexes;
161 const QAbstractItemModel* model = index.model();
162 int row = index.row();
167 for (
int column = 0; column < model->columnCount(); ++column )
169 indexes.append( model->index( row, column ) );
QgsFeatureIds mDeselectedBuffer
QgsFeatureSelectionModel(QAbstractItemModel *model, QgsFeatureModel *featureModel, QgsVectorLayer *layer, QObject *parent)
virtual bool isSelected(QgsFeatureId fid)
Returns the selection status of a given feature id.
QSet< QgsFeatureId > QgsFeatureIds
void select(QgsRectangle &rect, bool addToSelection)
Select features found within the search rectangle (in layer's coordinates)
void enableSync(bool enable)
Enables or disables synchronisation to the QgsVectorLayer When synchronisation is disabled...
virtual QModelIndex fidToIndex(QgsFeatureId fid)=0
void deselect(const QgsFeatureId featureId)
Deselect feature by its ID.
void requestRepaint()
Request a repaint of the visible items of connected views.
const QgsFeatureIds & selectedFeaturesIds() const
Return reference to identifiers of selected features.
virtual void selectFeatures(const QItemSelection &selection, SelectionFlags command)
Select features on this table.
virtual void layerSelectionChanged(QgsFeatureIds selected, QgsFeatureIds deselected, bool clearAndSelect)
void setSelectedFeatures(const QgsFeatureIds &ids)
Change selection to the new set of features.
Represents a vector layer which manages a vector based data sets.
QgsFeatureIds mSelectedBuffer
bool mClearAndSelectBuffer
QgsFeatureModel * mFeatureModel
QModelIndexList expandIndexToRow(const QModelIndex &index) const