15#ifndef QGSQUERYBUILDER_H
16#define QGSQUERYBUILDER_H
20#include <QStandardItemModel>
21#include <QSortFilterProxyModel>
22#include <QStandardItem>
24#include "ui_qgsquerybuilderbase.h"
57 Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
59 void showEvent( QShowEvent *event )
override;
65 void setSql(
const QString &sqlStatement );
68 void setSubsetString(
const QString &subsetString )
override { setSql( subsetString ); }
85 QWidget *codeEditorWidget()
const;
100 static bool saveQueryToFile(
const QString &subset );
106 static bool loadQueryFromFile( QString &subset );
109 void accept()
override;
110 void reject()
override;
134 void setDatasourceDescription(
const QString &uri );
137 void btnEqual_clicked();
138 void btnLessThan_clicked();
139 void btnGreaterThan_clicked();
140 void btnPct_clicked();
141 void btnIn_clicked();
142 void btnNotIn_clicked();
143 void btnLike_clicked();
144 void btnILike_clicked();
145 void lstFields_clicked(
const QModelIndex &index );
146 void lstFields_doubleClicked(
const QModelIndex &index );
147 void lstValues_doubleClicked(
const QModelIndex &index );
148 void btnLessEqual_clicked();
149 void btnGreaterEqual_clicked();
150 void btnNotEqual_clicked();
151 void btnAnd_clicked();
152 void btnNot_clicked();
153 void btnOr_clicked();
154 void onTextChanged(
const QString &text );
155 void layerSubsetStringChanged();
161 void btnGetAllValues_clicked();
168 void btnSampleValues_clicked();
175 void populateFields();
182 void setupGuiViews();
183 void setupLstFieldsModel();
184 void fillValues(
int idx,
int limit );
188 QStandardItemModel *mModelFields =
nullptr;
190 QStandardItemModel *mModelValues =
nullptr;
192 QSortFilterProxyModel *mProxyValues =
nullptr;
194 int mPreviousFieldRow;
200 QString mOrigSubsetString;
203 bool mIgnoreLayerSubsetStringChangedSignal =
false;
205 friend class TestQgsQueryBuilder;
A text editor based on QScintilla2.
Query Builder for layers.
QString subsetString() const override
Returns the subset string entered in the dialog.
void setSubsetString(const QString &subsetString) override
Sets a subset string into the dialog.
QgsCodeEditor * codeEditorWidget() const
Returns the code editor widget for the SQL.
Interface for a dialog that can edit subset strings.
Represents a vector layer which manages a vector based data sets.
#define SIP_IF_FEATURE(feature)