|
QGIS API Documentation
master-6164ace
|
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: 00050 QgsQueryBuilder( QgsVectorLayer *layer, QWidget *parent = 0, 00051 Qt::WFlags fl = QgisGui::ModalDialogFlags ); 00052 00053 ~QgsQueryBuilder(); 00054 00055 public slots: 00056 void accept(); 00057 void reject(); 00058 void clear(); 00059 void on_btnEqual_clicked(); 00060 void on_btnLessThan_clicked(); 00061 void on_btnGreaterThan_clicked(); 00062 void on_btnPct_clicked(); 00063 void on_btnIn_clicked(); 00064 void on_btnNotIn_clicked(); 00065 void on_btnLike_clicked(); 00066 void on_btnILike_clicked(); 00067 QString sql(); 00068 void setSql( QString sqlStatement ); 00069 void on_lstFields_clicked( const QModelIndex &index ); 00070 void on_lstFields_doubleClicked( const QModelIndex &index ); 00071 void on_lstValues_doubleClicked( const QModelIndex &index ); 00072 void on_btnLessEqual_clicked(); 00073 void on_btnGreaterEqual_clicked(); 00074 void on_btnNotEqual_clicked(); 00075 void on_btnAnd_clicked(); 00076 void on_btnNot_clicked(); 00077 void on_btnOr_clicked(); 00078 00079 void on_buttonBox_helpRequested() { QgsContextHelp::run( metaObject()->className() ); } 00080 00086 void test(); 00091 void on_btnGetAllValues_clicked(); 00097 void on_btnSampleValues_clicked(); 00098 00099 void setDatasourceDescription( QString uri ); 00100 00101 private: 00105 void populateFields(); 00106 00110 void setupGuiViews(); 00111 void setupLstFieldsModel(); 00112 void fillValues( int idx, int limit ); 00113 00114 // private members 00116 QStandardItemModel *mModelFields; 00118 QStandardItemModel *mModelValues; 00120 int mPreviousFieldRow; 00121 00123 QgsVectorLayer *mLayer; 00124 00126 QString mOrigSubsetString; 00127 }; 00128 #endif //QGSQUERYBUILDER_H