Subversion Repositories OpenInventory

Rev

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

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