00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef SQLBROWSER_H
00029 #define SQLBROWSER_H
00030
00031
00032 #include "DigestGuiCore/guicomponentwidgets.h"
00033
00034 #include <QRegExp>
00035 #include <QSqlQuery>
00036
00037 #include "ui_sqlbrowserform.h"
00038
00039
00040 class QSqlQueryModel;
00041 class QSqlTableModel;
00042
00043
00044 class SqlBrowser: public GuiDbComponentDialog {
00045
00046 Q_OBJECT
00047
00048 public:
00049 SqlBrowser( AbstractController* controller,
00050 QWidget* parent = 0, Qt::WindowFlags flags = 0 );
00051
00052 protected:
00053 void showEvent( QShowEvent* );
00054
00055 void resetEvent( VEvent* );
00056 void classesEvent( VClassesEvent* );
00057 void collectionsEvent( VCollectionsEvent* );
00058 void experimentsEvent( VExperimentsEvent* );
00059 void gesturesEvent( VGesturesEvent* );
00060 void trainedRecogsEvent( VTrainedRecogsEvent* );
00061
00062
00063 private slots:
00064 void refreshQuery();
00065 void importData();
00066 void exportData();
00067 void execUserQuery();
00068 void showTable( const QString& table );
00069 void setQueryStatus( const QString& message );
00070 void refreshTableList();
00071 void updateNumRecordsLabel();
00072
00073 void on_tableListWidget_itemSelectionChanged();
00074 void on_submitButton_clicked();
00075 void on_clearButton_clicked();
00076
00077
00078 private:
00079 static QString formatSqlValue( QString value );
00080
00081
00082 Ui::SqlBrowserForm m_ui;
00083 QSqlTableModel* m_editModel;
00084 QSqlQueryModel* m_queryModel;
00085 QString m_queryString;
00086
00087
00088 QRegExp c_regexp;
00089 };
00090
00091
00092 #endif // ! SQLBROWSER_H