1  #ifndef MAINWINDOW_H
2  #define MAINWINDOW_H

3  #include <QMainWindow>
4  #include <QSqlRelationalTableModel>
5  #include <QSqlRelationalDelegate>
6  #include <QSqlRelation>

7  /* Connect the header file for work with the database */
8  #include "database.h"

9  namespace Ui {
10 class MainWindow;
11 }

12 class MainWindow : public QMainWindow
13 {
14     Q_OBJECT

15 public:
16    explicit MainWindow(QWidget *parent = 0);
17    ~MainWindow();

18 private:
19    Ui::MainWindow  *ui;
    /* The project uses objects to interact with the database
     *  and model representation database table
     * */
20    DataBase                    *db;
21    QSqlRelationalTableModel    *modelMain;
22    QSqlRelationalTableModel    *modelDevice;
    /* Also present are two methods that form the
     * model and appearance TableView
     * */
23    void setupMainModel(const QString &tableName, const QStringList &headers);
24    void setupDeviceModel(const QString &tableName, const QStringList &headers);
25    void createUI();
26 };

27 #endif // MAINWINDOW_H
