QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgssearchquerybuilder.h
Go to the documentation of this file.
1/***************************************************************************
2 qgssearchquerybuilder.h - Query builder for search strings
3 ----------------------
4 begin : March 2006
5 copyright : (C) 2006 by Martin Dobias
6 email : wonder.sk at gmail dot com
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 QGSSEARCHQUERYBUILDER_H
17#define QGSSEARCHQUERYBUILDER_H
18
19#include <map>
20#include <vector>
21#include <QStandardItemModel>
22#include <QModelIndex>
23
24#include "ui_qgsquerybuilderbase.h"
25#include "qgsguiutils.h"
26#include "qgis_gui.h"
27
28class QgsField;
29class QgsVectorLayer;
30
37class GUI_EXPORT QgsSearchQueryBuilder : public QDialog, private Ui::QgsQueryBuilderBase
38{
39 Q_OBJECT
40
41 public:
43 QgsSearchQueryBuilder( QgsVectorLayer *layer, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
44
46 QString searchString();
47
49 void setSearchString( const QString &searchString );
50
51 public slots:
52
53 void saveQuery();
54 void loadQuery();
55
56 private slots:
57 void btnEqual_clicked();
58 void btnOk_clicked();
59 void btnLessThan_clicked();
60 void btnGreaterThan_clicked();
61 void btnLike_clicked();
62 void btnILike_clicked();
63 void btnPct_clicked();
64 void btnIn_clicked();
65 void btnNotIn_clicked();
66
67 void lstFields_doubleClicked( const QModelIndex &index );
68 void lstValues_doubleClicked( const QModelIndex &index );
69 void btnLessEqual_clicked();
70 void btnGreaterEqual_clicked();
71 void btnNotEqual_clicked();
72 void btnAnd_clicked();
73 void btnNot_clicked();
74 void btnOr_clicked();
75 void btnClear_clicked();
76
81 void btnTest_clicked();
82
87 void btnGetAllValues_clicked();
88
94 void btnSampleValues_clicked();
95
96 private:
100 void populateFields();
101
105 void setupListViews();
106
111 long countRecords( const QString &sql );
112
117 void getFieldValues( int limit );
118
122 void showHelp();
123
124 private:
126 QgsVectorLayer *mLayer = nullptr;
128 QMap<QString, int> mFieldMap;
130 QStandardItemModel *mModelFields = nullptr;
132 QStandardItemModel *mModelValues = nullptr;
133};
134#endif //QGSSEARCHQUERYBUILDER_H
Encapsulate a field in an attribute table or data source.
Definition qgsfield.h:53
Query Builder for search strings.
Represents a vector layer which manages a vector based data sets.
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53