QGIS API Documentation  2.99.0-Master (b058df7)
Public Slots | Public Member Functions | List of all members
QgsQueryBuilder Class Reference

Query Builder for layers. More...

#include <qgsquerybuilder.h>

Inheritance diagram for QgsQueryBuilder:
Inheritance graph
[legend]

Public Slots

void accept () override
 
void clear ()
 
void reject () override
 
void setDatasourceDescription (const QString &uri)
 
void test ()
 Test the constructed sql statement to see if the vector layer data provider likes it. More...
 

Public Member Functions

 QgsQueryBuilder (QgsVectorLayer *layer, QWidget *parent=0, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
 This constructor is used when the query builder is called from the vector layer properties dialog. More...
 
 ~QgsQueryBuilder ()
 
void setSql (const QString &sqlStatement)
 
void showEvent (QShowEvent *event) override
 
QString sql ()
 

Detailed Description

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 42 of file qgsquerybuilder.h.

Constructor & Destructor Documentation

◆ QgsQueryBuilder()

QgsQueryBuilder::QgsQueryBuilder ( QgsVectorLayer layer,
QWidget *  parent = 0,
Qt::WindowFlags  fl = QgsGuiUtils::ModalDialogFlags 
)

This constructor is used when the query builder is called from the vector layer properties dialog.

Parameters
layerexisting vector layer
parentParent widget
fldialog flags

Definition at line 28 of file qgsquerybuilder.cpp.

◆ ~QgsQueryBuilder()

QgsQueryBuilder::~QgsQueryBuilder ( )

Definition at line 79 of file qgsquerybuilder.cpp.

Member Function Documentation

◆ accept

void QgsQueryBuilder::accept ( )
overrideslot

Definition at line 248 of file qgsquerybuilder.cpp.

◆ clear

void QgsQueryBuilder::clear ( )
slot

Definition at line 402 of file qgsquerybuilder.cpp.

◆ reject

void QgsQueryBuilder::reject ( )
overrideslot

Definition at line 272 of file qgsquerybuilder.cpp.

◆ setDatasourceDescription

void QgsQueryBuilder::setDatasourceDescription ( const QString &  uri)
slot

Definition at line 415 of file qgsquerybuilder.cpp.

◆ setSql()

void QgsQueryBuilder::setSql ( const QString &  sqlStatement)

Definition at line 327 of file qgsquerybuilder.cpp.

◆ showEvent()

void QgsQueryBuilder::showEvent ( QShowEvent *  event)
override

Definition at line 85 of file qgsquerybuilder.cpp.

◆ sql()

QString QgsQueryBuilder::sql ( )

Definition at line 322 of file qgsquerybuilder.cpp.

◆ test

void QgsQueryBuilder::test ( )
slot

Test 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 218 of file qgsquerybuilder.cpp.


The documentation for this class was generated from the following files: