Subversion Repositories OpenInventory

Rev

Rev 91 | Rev 94 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 91 Rev 93
1
#ifndef MAINWINDOW_H
1
#ifndef MAINWINDOW_H
2
#define MAINWINDOW_H
2
#define MAINWINDOW_H
3
3
-
 
4
-
 
5
//#include "mysql.h"
4
#include <QMainWindow>
6
#include <QMainWindow>
5
#include <QStandardItemModel>
7
#include <QStandardItemModel>
6
#include <QStandardItem>
8
#include <QStandardItem>
7
#include <QTreeWidgetItem>
9
#include <QTreeWidgetItem>
8
#include <QTextCodec>
10
#include <QTextCodec>
9
#include <QSqlDatabase>
11
#include <QSqlDatabase>
10
12
11
#include <QtGui>
13
#include <QtGui>
-
 
14
#include <QString>
-
 
15
#include <QtSql>
-
 
16
-
 
17
-
 
18
/*
-
 
19
#include <QSqlField>
-
 
20
#include <QSqlRecord>
-
 
21
#include <QSqlTableModel>
-
 
22
#include <QSqlQueryModel>
-
 
23
#include <QTableView>
-
 
24
#include <QSqlDriverPlugin>
-
 
25
#include <QIcon>
-
 
26
#include <QVariant>
-
 
27
#include <QProcess>
-
 
28
#include <QByteArray>
-
 
29
*/
-
 
30
-
 
31
-
 
32
-
 
33
-
 
34
12
35
13
namespace Ui {
36
namespace Ui {
14
    class MainWindow;
37
    class MainWindow;
15
}
38
}
16
39
17
class MainWindow : public QMainWindow {
40
class MainWindow : public QMainWindow {
18
    Q_OBJECT
41
    Q_OBJECT
19
public:
42
public:
20
    MainWindow(QWidget *parent = 0);
43
    MainWindow(QWidget *parent = 0);
21
    ~MainWindow();
44
    ~MainWindow();
22
45
23
protected:
46
protected:
24
    void changeEvent(QEvent *e);
47
    void changeEvent(QEvent *e);
25
48
26
private:
49
private:
27
    Ui::MainWindow *ui;
50
    Ui::MainWindow *ui;
28
51
29
    QStandardItemModel *model;
52
    QStandardItemModel *model;
30
    QStandardItem *item;
53
    QStandardItem *item;
31
    QTreeWidgetItem *rootItem1, *rootItem2;
54
    QTreeWidgetItem *rootItem1, *rootItem2;
32
    void openBase();
55
    void openBase();
33
    bool readModel();
56
    bool readModel();
34
    void setupModelData(const QStringList &lines, QTreeWidgetItem *parent);
57
    void setupModelData(const QStringList &lines, QTreeWidgetItem *parent);
35
    void creatModelString();
58
    void creatModelString();
36
    QString modelString; // ñòðîêà, îïèñûâàþùàÿ ìîäåëü ïðåäñòàâëåíèÿ
59
    QString modelString; // ñòðîêà, îïèñûâàþùàÿ ìîäåëü ïðåäñòàâëåíèÿ
37
    void addChildsString(QTreeWidgetItem *parentItem, int level);
60
    void addChildsString(QTreeWidgetItem *parentItem, int level);
-
 
61
-
 
62
    QSqlDatabase sql;
-
 
63
-
 
64
    bool openDataBase();
-
 
65
-
 
66
38
};
67
};
39
68
40
#endif // MAINWINDOW_H
69
#endif // MAINWINDOW_H
41
 
70