• Main Page
  • Related Pages
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

tableeditor.h

Go to the documentation of this file.
00001 #ifndef TABLEEDITOR_H
00002 #define TABLEEDITOR_H
00003 
00004 #include <QDialog>
00005 #include <QPushButton>
00006 #include <QDialogButtonBox>
00007 #include <QSqlTableModel>
00008 
00009 #include "database.h"
00010 
00011 //class TableEditorModel : public QSqlTableModel {
00012 //    //This class is not used, but it does have an efficient algoritm to quickly remove id columns
00013 //public:
00014 //    TableEditorModel(QObject *parent = 0) : QSqlTableModel(parent, Database::staticCon()){
00015 //    }
00016 //
00017 //    void setTable(const QString &tableName){
00018 //        QSqlTableModel::setTable(tableName);
00019 //        int i = 0;
00020 //        while(i < columnCount()){
00021 //            QRegExp regExp("_id");
00022 //            if (headerData(i, Qt::Horizontal, Qt::DisplayRole).toString().contains(regExp)){
00023 //                removeColumns(i, 1);
00024 //                continue;
00025 //            }
00026 //            i++;
00027 //        }
00028 //    }
00029 //};
00030 
00036 class TableEditor : public QDialog
00037 {
00038     Q_OBJECT
00039 
00040 public:
00041     TableEditor(const QString &tableName, QWidget *parent = 0);
00042     ~TableEditor();
00043 
00044 private slots:
00045     void submit();
00046     void addNewRecord();
00047 
00048 private:
00049     QPushButton *submitButton;
00050     QPushButton *revertButton;
00051     QPushButton *quitButton;
00052     QPushButton *addNewRecordButton;
00053 
00054     QDialogButtonBox *buttonBox;
00055     QSqlTableModel *model;
00056 };
00057 
00058 #endif

Generated on Tue Aug 24 2010 15:58:55 for Smartlet by  doxygen 1.7.1