QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
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->
selectedFeaturesIds
();
41
}
42
43
void
QgsFeatureSelectionDlg::setSelectedFeatures
(
const
QgsFeatureIds
& ids )
44
{
45
mFeatureSelection->
setSelectedFeatures
( ids );
46
}
47
48
qgsattributeeditorcontext.h
QWidget
QWidget::setupUi
void setupUi(QWidget *widget)
QgsAttributeEditorContext
This class contains context information for attribute editor widgets.
Definition:
qgsattributeeditorcontext.h:33
QgsGenericFeatureSelectionManager::selectedFeaturesIds
virtual const QgsFeatureIds & selectedFeaturesIds() const override
Return reference to identifiers of selected features.
Definition:
qgsgenericfeatureselectionmanager.cpp:55
QgsFeatureSelectionDlg::QgsFeatureSelectionDlg
QgsFeatureSelectionDlg(QgsVectorLayer *vl, QgsAttributeEditorContext &context, QWidget *parent=nullptr)
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:63
qgsgenericfeatureselectionmanager.h
QSet
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:28
qgsdistancearea.h
QDialog
QgsGenericFeatureSelectionManager::setSelectedFeatures
virtual 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:408
Generated on Sun Jun 24 2018 11:42:48 for QGIS API Documentation by
1.8.13