Fri, 11 Feb 2022 12:02:09 +0100
We have a mainscreen!
3 | 1 | #ifndef _DATABASE_H |
2 | #define _DATABASE_H | |
3 | ||
4 | #include <QSqlDatabase> | |
5 | #include <QDebug> | |
6 | #include <QSettings> | |
7 | ||
8 | ||
9 | class DataBase : public QObject | |
10 | { | |
11 | Q_OBJECT | |
12 | ||
13 | public: | |
14 | explicit DataBase(QObject *parent = 0); | |
15 | ~DataBase(); | |
16 | void connectToDataBase(); | |
17 | ||
18 | private: | |
19 | QSqlDatabase db; | |
20 | ||
21 | private: | |
22 | bool openDataBase(); | |
23 | void closeDataBase(); | |
24 | }; | |
25 | ||
26 | ||
27 | static DataBase *db; | |
28 | ||
29 | ||
30 | #endif |