QGIS API Documentation  2.6.0-Brighton
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Slots | Public Member Functions | List of all members
QgsQueryBuilder Class Reference

Query Builder for layers. More...

#include <qgsquerybuilder.h>

Public Slots

void accept ()
void reject ()
void clear ()
void on_btnEqual_clicked ()
void on_btnLessThan_clicked ()
void on_btnGreaterThan_clicked ()
void on_btnPct_clicked ()
void on_btnIn_clicked ()
void on_btnNotIn_clicked ()
void on_btnLike_clicked ()
void on_btnILike_clicked ()
QString sql ()
void setSql (QString sqlStatement)
void on_lstFields_clicked (const QModelIndex &index)
void on_lstFields_doubleClicked (const QModelIndex &index)
void on_lstValues_doubleClicked (const QModelIndex &index)
void on_btnLessEqual_clicked ()
void on_btnGreaterEqual_clicked ()
void on_btnNotEqual_clicked ()
void on_btnAnd_clicked ()
void on_btnNot_clicked ()
void on_btnOr_clicked ()
void on_buttonBox_helpRequested ()
void test ()
void on_btnGetAllValues_clicked ()
void on_btnSampleValues_clicked ()
void setDatasourceDescription (QString uri)

Public Member Functions

 QgsQueryBuilder (QgsVectorLayer *layer, QWidget *parent=0, Qt::WindowFlags fl=QgisGui::ModalDialogFlags)
 ~QgsQueryBuilder ()
void showEvent (QShowEvent *event)

Detailed Description

Query Builder for layers.

The query builder allows interactive creation of a SQL for limiting the features displayed in a database 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.

Constructor & Destructor Documentation

QgsQueryBuilder::QgsQueryBuilder ( QgsVectorLayer layer,
QWidget *  parent = 0,
Qt::WindowFlags  fl = QgisGui::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
QgsQueryBuilder::~QgsQueryBuilder ( )

Member Function Documentation

void QgsQueryBuilder::accept ( )
slot
void QgsQueryBuilder::clear ( )
slot
void QgsQueryBuilder::on_btnAnd_clicked ( )
slot
void QgsQueryBuilder::on_btnEqual_clicked ( )
slot
void QgsQueryBuilder::on_btnGetAllValues_clicked ( )
slot

Get all distinct values for the field. Values are inserted into the value list box

void QgsQueryBuilder::on_btnGreaterEqual_clicked ( )
slot
void QgsQueryBuilder::on_btnGreaterThan_clicked ( )
slot
void QgsQueryBuilder::on_btnILike_clicked ( )
slot
void QgsQueryBuilder::on_btnIn_clicked ( )
slot
void QgsQueryBuilder::on_btnLessEqual_clicked ( )
slot
void QgsQueryBuilder::on_btnLessThan_clicked ( )
slot
void QgsQueryBuilder::on_btnLike_clicked ( )
slot
void QgsQueryBuilder::on_btnNot_clicked ( )
slot
void QgsQueryBuilder::on_btnNotEqual_clicked ( )
slot
void QgsQueryBuilder::on_btnNotIn_clicked ( )
slot
void QgsQueryBuilder::on_btnOr_clicked ( )
slot
void QgsQueryBuilder::on_btnPct_clicked ( )
slot
void QgsQueryBuilder::on_btnSampleValues_clicked ( )
slot

Get sample distinct values for the selected field. The sample size is limited to an arbitrary value (currently set to 25). The values are inserted into the values list box.

void QgsQueryBuilder::on_buttonBox_helpRequested ( )
inlineslot
void QgsQueryBuilder::on_lstFields_clicked ( const QModelIndex &  index)
slot
void QgsQueryBuilder::on_lstFields_doubleClicked ( const QModelIndex &  index)
slot
void QgsQueryBuilder::on_lstValues_doubleClicked ( const QModelIndex &  index)
slot
void QgsQueryBuilder::reject ( )
slot
void QgsQueryBuilder::setDatasourceDescription ( QString  uri)
slot
void QgsQueryBuilder::setSql ( QString  sqlStatement)
slot
void QgsQueryBuilder::showEvent ( QShowEvent *  event)
QString QgsQueryBuilder::sql ( )
slot
void QgsQueryBuilder::test ( )
slot

Test the constructed sql statement to see if the database 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.


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