Quantum GIS API Documentation  1.8
src/gui/qgsquerybuilder.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     qgsquerybuilder.h - query builder
00003      --------------------------------------
00004     Date                 : 2004-11-19
00005     Copyright            : (C) 2004 by Gary E.Sherman
00006     Email                : sherman at mrcc.com
00007  ***************************************************************************
00008  *                                                                         *
00009  *   This program is free software; you can redistribute it and/or modify  *
00010  *   it under the terms of the GNU General Public License as published by  *
00011  *   the Free Software Foundation; either version 2 of the License, or     *
00012  *   (at your option) any later version.                                   *
00013  *                                                                         *
00014  ***************************************************************************/
00015 #ifndef QGSQUERYBUILDER_H
00016 #define QGSQUERYBUILDER_H
00017 #include <map>
00018 #include <vector>
00019 #include <QStandardItemModel>
00020 #include <QStandardItem>
00021 #include <QModelIndex>
00022 #include "ui_qgsquerybuilderbase.h"
00023 #include "qgisgui.h"
00024 #include "qgsfield.h"
00025 #include "qgscontexthelp.h"
00026 
00027 class QgsVectorLayer;
00028 
00040 class GUI_EXPORT QgsQueryBuilder : public QDialog, private Ui::QgsQueryBuilderBase
00041 {
00042     Q_OBJECT
00043   public:
00051     QgsQueryBuilder( QString tableName, QWidget *parent = 0,
00052                      Qt::WFlags fl = QgisGui::ModalDialogFlags );
00053 
00060     QgsQueryBuilder( QgsVectorLayer *layer, QWidget *parent = 0,
00061                      Qt::WFlags fl = QgisGui::ModalDialogFlags );
00062 
00063     ~QgsQueryBuilder();
00064 
00065   public slots:
00066     void accept();
00067     void reject();
00068     void clear();
00069     void on_btnEqual_clicked();
00070     void on_btnLessThan_clicked();
00071     void on_btnGreaterThan_clicked();
00072     void on_btnPct_clicked();
00073     void on_btnIn_clicked();
00074     void on_btnNotIn_clicked();
00075     void on_btnLike_clicked();
00076     void on_btnILike_clicked();
00077     QString sql();
00078     void setSql( QString sqlStatement );
00079     void on_lstFields_clicked( const QModelIndex &index );
00080     void on_lstFields_doubleClicked( const QModelIndex &index );
00081     void on_lstValues_doubleClicked( const QModelIndex &index );
00082     void on_btnLessEqual_clicked();
00083     void on_btnGreaterEqual_clicked();
00084     void on_btnNotEqual_clicked();
00085     void on_btnAnd_clicked();
00086     void on_btnNot_clicked();
00087     void on_btnOr_clicked();
00088 
00089     void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); }
00090 
00091 
00097     void test();
00102     void on_btnGetAllValues_clicked();
00108     void on_btnSampleValues_clicked();
00109     void setDatasourceDescription( QString uri );
00110 
00111   private:
00115     void populateFields();
00116 
00120     void setupGuiViews();
00121     void setupLstFieldsModel();
00122     void fillValues( int idx, int limit );
00123 
00124     // private members
00126     QStandardItemModel *mModelFields;
00128     QStandardItemModel *mModelValues;
00130     int mPreviousFieldRow;
00131 
00133     QgsVectorLayer *mLayer;
00134 
00136     QString mOrigSubsetString;
00137 };
00138 #endif //QGSQUERYBUILDER_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines