Subversion Repositories OpenInventory

Rev

Rev 122 | Rev 138 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 122 Rev 126
Line 4... Line 4...
4
#include <QItemDelegate>
4
#include <QItemDelegate>
5
#include <QModelIndex>
5
#include <QModelIndex>
6
#include <QObject>
6
#include <QObject>
7
#include <QSize>
7
#include <QSize>
8
#include <QSpinBox>
8
#include <QSpinBox>
-
 
9
#include <QSqlQuery>
-
 
10
#include <QtSql>
-
 
11
#include <QtGui>
-
 
12
#include <QSqlDatabase>
-
 
13
#include <QMessageBox>
-
 
14
//#include <QMainWindow>
9
-
 
10
-
 
11
//! [0]
15
//! [0]
12
class SpinBoxDelegate : public QItemDelegate
16
class SpinBoxDelegate : public QItemDelegate
13
{
17
{
14
    Q_OBJECT
18
    Q_OBJECT
15
19
Line 23... Line 27...
23
    void setModelData(QWidget *editor, QAbstractItemModel *model,
27
    void setModelData(QWidget *editor, QAbstractItemModel *model,
24
                      const QModelIndex &index) const;
28
                      const QModelIndex &index) const;
25
29
26
    void updateEditorGeometry(QWidget *editor,
30
    void updateEditorGeometry(QWidget *editor,
27
        const QStyleOptionViewItem &option, const QModelIndex &index) const;
31
        const QStyleOptionViewItem &option, const QModelIndex &index) const;
-
 
32
-
 
33
-
 
34
-
 
35
    void setInctance(QString newInctance);
-
 
36
    void getItems(); // ïîëó÷àåì ñâÿçàííûé ñïèñîê
-
 
37
-
 
38
-
 
39
-
 
40
-
 
41
private:
-
 
42
-
 
43
-
 
44
    QString inctance; // òàáëèöà-õðàíèëèùå, îòêóäà áóäåì áðàòü ñïèñîê
-
 
45
    QMap <QString, QString> items; // çäåñü áóäåì õðàíèòü ñâÿçàííûé ñïèñîê èìåò îáúåêòîâ è èõ èäåíòèôèêàòîðîâ ID
-
 
46
-
 
47
-
 
48
-
 
49
-
 
50
-
 
51
-
 
52
28
};
53
};
29
//! [0]
54
//! [0]
30
55
31
class MyDEDelegate : public QItemDelegate {
56
class MyDEDelegate : public QItemDelegate {
32
       Q_OBJECT
57
       Q_OBJECT