Subversion Repositories OpenInventory

Rev

Rev 99 | Rev 104 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
88 pingvin 1
#ifndef MAINWINDOW_H
2
#define MAINWINDOW_H
3
 
93 pingvin 4
 
5
//#include "mysql.h"
88 pingvin 6
#include <QMainWindow>
7
#include <QStandardItemModel>
8
#include <QStandardItem>
9
#include <QTreeWidgetItem>
10
#include <QTextCodec>
89 pingvin 11
#include <QSqlDatabase>
88 pingvin 12
 
89 pingvin 13
#include <QtGui>
93 pingvin 14
#include <QString>
15
#include <QtSql>
89 pingvin 16
 
93 pingvin 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
 
99 pingvin 31
typedef struct Class {
32
        QString name;
33
        QString ID;
93 pingvin 34
 
99 pingvin 35
} TClass;
93 pingvin 36
 
37
 
38
 
39
 
88 pingvin 40
namespace Ui {
41
    class MainWindow;
42
}
43
 
44
class MainWindow : public QMainWindow {
45
    Q_OBJECT
46
public:
47
    MainWindow(QWidget *parent = 0);
48
    ~MainWindow();
49
 
50
protected:
51
    void changeEvent(QEvent *e);
52
 
53
private:
54
    Ui::MainWindow *ui;
55
 
56
    QStandardItemModel *model;
57
    QStandardItem *item;
58
    QTreeWidgetItem *rootItem1, *rootItem2;
89 pingvin 59
    void openBase();
60
    bool readModel();
61
    void setupModelData(const QStringList &lines, QTreeWidgetItem *parent);
91 pingvin 62
    void creatModelString();
63
    QString modelString; // ,   
64
    void addChildsString(QTreeWidgetItem *parentItem, int level);
93 pingvin 65
 
66
    QSqlDatabase sql;
67
 
68
    bool openDataBase();
97 pingvin 69
    bool buildPreviewModel(QString modelName, QString rootClassID);
95 pingvin 70
    QString ClassName(QString class_id); //     ID
98 pingvin 71
    void addChildsItems(QTreeWidgetItem *perent_class_item); //          ,      
99 pingvin 72
    QStringList classChields(QString class_id);
102 pingvin 73
    QMap <QString, QString> getClassList(); //   
93 pingvin 74
 
88 pingvin 75
};
76
 
77
#endif // MAINWINDOW_H