QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsfeatureselectiondlg.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsfeatureselectiondlg.h
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#ifndef QGSFEATURESELECTIONDLG_H
17#define QGSFEATURESELECTIONDLG_H
18
20
21#include "ui_qgsfeatureselectiondlg.h"
22
23#include "qgis_gui.h"
24#include "qgis_sip.h"
25
26#ifdef SIP_RUN
27// This is required for the ConvertToSubClassCode to work properly
28// so RTTI for casting is available in the whole module.
29//%ModuleCode
31//%End
32#endif
33
39class GUI_EXPORT QgsFeatureSelectionDlg : public QDialog, private Ui::QgsFeatureSelectionDlg
40{
41#ifdef SIP_RUN
43 if ( qobject_cast<QgsFeatureSelectionDlg *>( sipCpp ) )
44 sipType = sipType_QgsFeatureSelectionDlg;
45 else
46 sipType = 0;
48#endif
49
50 Q_OBJECT
51
52 public:
54 explicit QgsFeatureSelectionDlg( QgsVectorLayer *vl, const QgsAttributeEditorContext &context, QWidget *parent SIP_TRANSFERTHIS = nullptr );
55
62
67 void setSelectedFeatures( const QgsFeatureIds &ids );
68
72 void setFilterExpression( const QString &filter, QgsAttributeForm::FilterType type );
73
74 protected:
75 void keyPressEvent( QKeyEvent *evt ) override;
76
78 void showEvent( QShowEvent *event ) override;
79
80 private slots:
81
85 void mActionInvertSelection_triggered();
86
90 void mActionRemoveSelection_triggered();
91
95 void mActionSelectAll_triggered();
96
100 void mActionZoomMapToSelectedRows_triggered();
101
105 void mActionPanMapToSelectedRows_triggered();
106
110 void mActionExpressionSelect_triggered();
111
115 void viewModeChanged( QgsAttributeEditorContext::Mode mode );
116
117 private:
118 QgsVectorLayerSelectionManager *mFeatureSelection = nullptr;
119 QgsVectorLayer *mVectorLayer = nullptr;
121};
122
123#endif // QGSFEATURESELECTIONDLG_H
Contains context information for attribute editor widgets.
FilterType
Filter types.
void setSelectedFeatures(const QgsFeatureIds &ids)
Set the selected features.
const QgsFeatureIds & selectedFeatures()
Gets the selected features.
QgsFeatureSelectionDlg(QgsVectorLayer *vl, const QgsAttributeEditorContext &context, QWidget *parent=nullptr)
Constructor for QgsFeatureSelectionDlg.
void setFilterExpression(const QString &filter, QgsAttributeForm::FilterType type)
Set form filter expression.
void showEvent(QShowEvent *event) override
Make sure the dialog does not grow too much.
void keyPressEvent(QKeyEvent *evt) override
Represents a vector layer which manages a vector based dataset.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition qgis_sip.h:199
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_END
Definition qgis_sip.h:216
QSet< QgsFeatureId > QgsFeatureIds