Редакция 45 | Редакция 73 | К новейшей редакции | Содержимое файла | Сравнить с предыдущей | Последнее изменение | Открыть журнал | RSS
Редакция | Автор | № строки | Строка |
---|---|---|---|
29 | pingvin | 1 | /************************************************************************************ |
2 | ** MySQL |
||
3 | ** MySQL class contains methods for working with databases |
||
4 | ** |
||
5 | ** |
||
6 | *************************************************************************************/ |
||
7 | |||
8 | |||
9 | |||
10 | |||
11 | |||
12 | |||
13 | #ifndef MYSQL_H |
||
14 | #define MYSQL_H |
||
15 | |||
38 | pingvin | 16 | #include "settingsdialog.h" |
17 | #include "tablefield.h" |
||
18 | #include "sqltable.h" |
||
19 | |||
29 | pingvin | 20 | #include <QObject> |
21 | #include <QtGui> |
||
22 | #include <QMainWindow> |
||
23 | #include <QString> |
||
24 | #include <QtSql> |
||
25 | #include <QSqlTableModel> |
||
26 | #include <QTableView> |
||
27 | #include <QSqlDriverPlugin> |
||
28 | #include <QIcon> |
||
29 | #include <QVariant> |
||
30 | #include <QProcess> |
||
31 | #include <QByteArray> |
||
32 | |||
33 | |||
34 | class MySql : public QObject |
||
35 | { |
||
36 | Q_OBJECT |
||
37 | public: |
||
38 | explicit MySql(QObject *parent = 0); |
||
39 | |||
44 | pingvin | 40 | bool connect(); // |
45 | pingvin | 41 | bool createDataBase(); // ( ListOfClasses DescriptionOfClasses) |
56 | pingvin | 42 | bool createListOfClassesTable(); // ( ListOfClasses) |
43 | bool createDescriptionOfClassesTable(); // ( DescriptionOfClasses) |
||
29 | pingvin | 44 | signals: |
45 | |||
46 | public slots: |
||
47 | |||
48 | private: |
||
41 | pingvin | 49 | QString sqlDatabaseName; // , |
50 | QString sqlUserName; // |
||
51 | QString sqlPassword; // |
||
52 | QString sqlHostName; // , |
||
29 | pingvin | 53 | QSqlDatabase db; |
45 | pingvin | 54 | QString mysqlLastError; |
29 | pingvin | 55 | |
56 | protected: |
||
57 | |||
58 | public: |
||
41 | pingvin | 59 | void setDatabaseName(QString dbname); |
60 | void setUserName(QString uname); |
||
61 | void setPassword(QString passwrd); |
||
62 | void setHostName(QString hname); |
||
44 | pingvin | 63 | bool createTable(SqlTable* table); // |
45 | pingvin | 64 | |
44 | pingvin | 65 | QString lasError(); |
42 | pingvin | 66 | |
45 | pingvin | 67 | |
29 | pingvin | 68 | }; |
69 | |||
70 | #endif // MYSQL_H |