36 lines
706 B
C
36 lines
706 B
C
|
#ifndef TABLEFORM_H
|
||
|
#define TABLEFORM_H
|
||
|
|
||
|
#include <QWidget>
|
||
|
#include <QSqlTableModel>
|
||
|
|
||
|
namespace Ui {
|
||
|
class TableForm;
|
||
|
}
|
||
|
|
||
|
class TableForm : public QWidget {
|
||
|
Q_OBJECT
|
||
|
public:
|
||
|
TableForm(QWidget *parent = 0);
|
||
|
~TableForm();
|
||
|
void setTable(const QString connectionName, const QString tableName);
|
||
|
|
||
|
protected:
|
||
|
void changeEvent(QEvent *e);
|
||
|
|
||
|
private:
|
||
|
Ui::TableForm *ui;
|
||
|
QSqlDatabase m_Database;
|
||
|
QSqlTableModel *m_DataModel;
|
||
|
QSqlQueryModel *m_QueryModel;
|
||
|
QString m_ConnectionName;
|
||
|
QString m_TableName;
|
||
|
|
||
|
private slots:
|
||
|
void on_QueryRunAction_triggered();
|
||
|
void on_DataRefreshAction_triggered();
|
||
|
void on_DataCommitAction_triggered();
|
||
|
};
|
||
|
|
||
|
#endif // TABLEFORM_H
|