QGIS API Documentation
3.0.2-Girona (307d082)
src
gui
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
18
#include "
qgsgenericfeatureselectionmanager.h
"
19
#include "
qgsdistancearea.h
"
20
#include "
qgsfeaturerequest.h
"
21
#include "
qgsattributeeditorcontext.h
"
22
23
24
QgsFeatureSelectionDlg::QgsFeatureSelectionDlg
(
QgsVectorLayer
*vl,
QgsAttributeEditorContext
&context, QWidget *parent )
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
38
const
QgsFeatureIds
&
QgsFeatureSelectionDlg::selectedFeatures
()
39
{
40
return
mFeatureSelection->
selectedFeatureIds
();
41
}
42
43
void
QgsFeatureSelectionDlg::setSelectedFeatures
(
const
QgsFeatureIds
&ids )
44
{
45
mFeatureSelection->
setSelectedFeatures
( ids );
46
}
47
48
qgsattributeeditorcontext.h
QgsFeatureIds
QSet< QgsFeatureId > QgsFeatureIds
Definition:
qgsfeature.h:544
QgsAttributeEditorContext
This class contains context information for attribute editor widgets.
Definition:
qgsattributeeditorcontext.h:35
QgsFeatureSelectionDlg::QgsFeatureSelectionDlg
QgsFeatureSelectionDlg(QgsVectorLayer *vl, QgsAttributeEditorContext &context, QWidget *parent=nullptr)
Constructor for QgsFeatureSelectionDlg.
Definition:
qgsfeatureselectiondlg.cpp:24
QgsFeatureSelectionDlg::selectedFeatures
const QgsFeatureIds & selectedFeatures()
Get the selected features.
Definition:
qgsfeatureselectiondlg.cpp:38
QgsFeatureRequest
This class wraps a request for features to a vector layer (or directly its vector data provider)...
Definition:
qgsfeaturerequest.h:67
qgsgenericfeatureselectionmanager.h
QgsFeatureSelectionDlg::setSelectedFeatures
void setSelectedFeatures(const QgsFeatureIds &ids)
Set the selected features.
Definition:
qgsfeatureselectiondlg.cpp:43
QgsGenericFeatureSelectionManager
This selection manager synchronizes a local set of selected features with an attribute table...
Definition:
qgsgenericfeatureselectionmanager.h:32
qgsdistancearea.h
QgsGenericFeatureSelectionManager::setSelectedFeatures
void setSelectedFeatures(const QgsFeatureIds &ids) override
Change selection to the new set of features.
Definition:
qgsgenericfeatureselectionmanager.cpp:46
qgsfeatureselectiondlg.h
qgsfeaturerequest.h
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition:
qgsvectorlayer.h:353
QgsGenericFeatureSelectionManager::selectedFeatureIds
const QgsFeatureIds & selectedFeatureIds() const override
Return reference to identifiers of selected features.
Definition:
qgsgenericfeatureselectionmanager.cpp:55
Generated on Sat Apr 21 2018 11:45:00 for QGIS API Documentation by
1.8.13