/
qgsselectbyformdialog.h
79 lines (62 loc) · 2.53 KB
/
qgsselectbyformdialog.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/***************************************************************************
qgsselectbyformdialog.h
----------------------
Date : June 2016
Copyright : (C) 2016 nyall Dawson
Email : nyall dot dawson at gmail dot com
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSSELECTBYFORMDIALOG_H
#define QGSSELECTBYFORMDIALOG_H
#include <QDialog>
#include "qgsattributeeditorcontext.h"
#include "qgis_app.h"
class QgsAttributeForm;
class QgsMessageBar;
class QgsVectorLayer;
class QgsMapCanvas;
/** \ingroup app
* \class QgsSelectByFormDialog
* A dialog for selecting features from a layer, using a form based off the layer's editor widgets.
* \since QGIS 2.16
*/
class APP_EXPORT QgsSelectByFormDialog : public QDialog
{
Q_OBJECT
public:
/** Constructor for QgsSelectByFormDialog
* \param layer vector layer to select from
* \param context editor context
* \param parent parent widget
* \param fl window flags
*/
QgsSelectByFormDialog( QgsVectorLayer *layer,
const QgsAttributeEditorContext &context = QgsAttributeEditorContext(),
QWidget *parent = nullptr, Qt::WindowFlags fl = 0 );
~QgsSelectByFormDialog();
/** Sets the message bar to display feedback from the form in. This is used in the search/filter
* mode to display the count of selected features.
* \param messageBar target message bar
* \since QGIS 2.16
*/
void setMessageBar( QgsMessageBar *messageBar );
/**
* Sets a map canvas associated with the dialog.
*/
void setMapCanvas( QgsMapCanvas *canvas );
private slots:
void zoomToFeatures( const QString &filter );
void flashFeatures( const QString &filter );
private:
QgsAttributeForm *mForm = nullptr;
QgsVectorLayer *mLayer = nullptr;
QgsMessageBar *mMessageBar = nullptr;
QgsMapCanvas *mMapCanvas = nullptr;
};
#endif // QGSSELECTBYFORMDIALOG_H