| QGIS API Documentation
    3.20.0-Odense (decaadbb31)
    | 
Query Builder for layers. More...
#include <qgsquerybuilder.h>

| Public Slots | |
| void | accept () override | 
| void | clear () | 
| void | loadQuery () | 
| Load query from the XML file.  More... | |
| void | reject () override | 
| void | saveQuery () | 
| Save query to the XML file.  More... | |
| void | setDatasourceDescription (const QString &uri) | 
| virtual void | test () | 
| The default implementation tests that the constructed sql statement to see if the vector layer data provider likes it.  More... | |
| Public Member Functions | |
| QgsQueryBuilder (QgsVectorLayer *layer, QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags) | |
| This constructor is used when the query builder is called from the vector layer properties dialog.  More... | |
| QgsCodeEditor * | codeEditorWidget () const | 
| Returns the code editor widget for the SQL.  More... | |
| void | setSql (const QString &sqlStatement) | 
| Set the sql statement to display in the dialog.  More... | |
| void | setSubsetString (const QString &subsetString) override | 
| Sets a subset string into the dialog.  More... | |
| void | showEvent (QShowEvent *event) override | 
| QString | sql () const | 
| Returns the sql statement entered in the dialog.  More... | |
| QString | subsetString () const override | 
| Returns the subset string entered in the dialog.  More... | |
|  Public Member Functions inherited from QgsSubsetStringEditorInterface | |
| QgsSubsetStringEditorInterface (QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags) | |
| Constructor.  More... | |
| Friends | |
| class | TestQgsQueryBuilder | 
Query Builder for layers.
The query builder allows interactive creation of a SQL for limiting the features displayed in a vector layer. The fields in the table are displayed and sample values (or all values) can be viewed to aid in constructing the query. A test function returns the number of features that will be returned.
Definition at line 44 of file qgsquerybuilder.h.
| QgsQueryBuilder::QgsQueryBuilder | ( | QgsVectorLayer * | layer, | 
| QWidget * | parent = nullptr, | ||
| Qt::WindowFlags | fl = QgsGuiUtils::ModalDialogFlags | ||
| ) | 
This constructor is used when the query builder is called from the vector layer properties dialog.
| layer | existing vector layer | 
| parent | Parent widget | 
| fl | dialog flags | 
Definition at line 38 of file qgsquerybuilder.cpp.
| 
 | overrideslot | 
Definition at line 281 of file qgsquerybuilder.cpp.
| 
 | slot | 
Definition at line 445 of file qgsquerybuilder.cpp.
| 
 | inline | 
Returns the code editor widget for the SQL.
Definition at line 93 of file qgsquerybuilder.h.
| 
 | slot | 
| 
 | overrideslot | 
Definition at line 308 of file qgsquerybuilder.cpp.
| 
 | slot | 
| 
 | slot | 
Definition at line 457 of file qgsquerybuilder.cpp.
| void QgsQueryBuilder::setSql | ( | const QString & | sqlStatement | ) | 
Set the sql statement to display in the dialog.
Definition at line 363 of file qgsquerybuilder.cpp.
| 
 | inlineoverridevirtual | 
Sets a subset string into the dialog.
Implements QgsSubsetStringEditorInterface.
Definition at line 68 of file qgsquerybuilder.h.
| 
 | override | 
Definition at line 101 of file qgsquerybuilder.cpp.
| QString QgsQueryBuilder::sql | ( | ) | const | 
Returns the sql statement entered in the dialog.
Definition at line 358 of file qgsquerybuilder.cpp.
| 
 | inlineoverridevirtual | 
Returns the subset string entered in the dialog.
Implements QgsSubsetStringEditorInterface.
Definition at line 67 of file qgsquerybuilder.h.
| 
 | virtualslot | 
The default implementation tests that the constructed sql statement to see if the vector layer data provider likes it.
The number of rows that would be returned is displayed in a message box. The test uses a "select count(*) from ..." query to test the SQL statement.
Definition at line 242 of file qgsquerybuilder.cpp.
| 
 | friend | 
Definition at line 193 of file qgsquerybuilder.h.