QGIS API Documentation  3.2.0-Bonn (bc43194)
qgsfeatureselectiondlg.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsfeatureselectiondlg.cpp
3  --------------------------------------
4  Date : 11.6.2013
5  Copyright : (C) 2013 Matthias Kuhn
6  Email : matthias at opengis dot ch
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #include "qgsfeatureselectiondlg.h"
17 
19 #include "qgsdistancearea.h"
20 #include "qgsfeaturerequest.h"
22 
23 
25  : QDialog( parent )
26  , mVectorLayer( vl )
27 {
28  setupUi( this );
29 
30  mFeatureSelection = new QgsGenericFeatureSelectionManager( mDualView );
31 
32  mDualView->setFeatureSelectionManager( mFeatureSelection );
33 
34  // TODO: Proper QgsDistanceArea, proper mapcanvas
35  mDualView->init( mVectorLayer, nullptr, QgsFeatureRequest(), context );
36 }
37 
39 {
40  return mFeatureSelection->selectedFeatureIds();
41 }
42 
44 {
45  mFeatureSelection->setSelectedFeatures( ids );
46 }
47 
48 
QSet< QgsFeatureId > QgsFeatureIds
Definition: qgsfeature.h:544
This class contains context information for attribute editor widgets.
QgsFeatureSelectionDlg(QgsVectorLayer *vl, QgsAttributeEditorContext &context, QWidget *parent=nullptr)
Constructor for QgsFeatureSelectionDlg.
const QgsFeatureIds & selectedFeatures()
Gets the selected features.
This class wraps a request for features to a vector layer (or directly its vector data provider)...
void setSelectedFeatures(const QgsFeatureIds &ids)
Set the selected features.
This selection manager synchronizes a local set of selected features with an attribute table...
void setSelectedFeatures(const QgsFeatureIds &ids) override
Change selection to the new set of features.
Represents a vector layer which manages a vector based data sets.
const QgsFeatureIds & selectedFeatureIds() const override
Returns reference to identifiers of selected features.