Subversion Repositories OpenInventory

Rev

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

Rev 52 Rev 134
Line 1... Line 1...
1
#ifndef DELEGATE_H
1
#ifndef DELEGATE_H
2
#define DELEGATE_H
2
#define DELEGATE_H
3
#include <QItemDelegate>
3
#include <QItemDelegate>
4
#include <QModelIndex>
4
#include <QModelIndex>
-
 
5
#include <QSqlQuery>
5
#include <QObject>
6
#include <QObject>
6
#include <QSize>
7
#include <QSize>
7
#include <QSpinBox>
8
#include <QSpinBox>
-
 
9
#include <QMap>
8
10
9
//! [0]
11
//! [0]
10
class SpinBoxDelegate : public QItemDelegate
12
class SpinBoxDelegate : public QItemDelegate
11
{
13
{
12
    Q_OBJECT
14
    Q_OBJECT
Line 21... Line 23...
21
    void setModelData(QWidget *editor, QAbstractItemModel *model,
23
    void setModelData(QWidget *editor, QAbstractItemModel *model,
22
                      const QModelIndex &index) const;
24
                      const QModelIndex &index) const;
23
25
24
    void updateEditorGeometry(QWidget *editor,
26
    void updateEditorGeometry(QWidget *editor,
25
        const QStyleOptionViewItem &option, const QModelIndex &index) const;
27
        const QStyleOptionViewItem &option, const QModelIndex &index) const;
-
 
28
-
 
29
    void getItems(); // ïîëó÷àåì ñâÿçàííûé ñïèñîê
-
 
30
-
 
31
private:
-
 
32
     QMap <QString, QString> items; // çäåñü áóäåì õðàíèòü ñâÿçàííûé ñïèñîê èìåò îáúåêòîâ è èõ èäåíòèôèêàòîðîâ ID
-
 
33
-
 
34
26
};
35
};
27
//! [0]
36
//! [0]
28
37
29
class MyDEDelegate : public QItemDelegate {
38
class MyDEDelegate : public QItemDelegate {
30
       Q_OBJECT
39
       Q_OBJECT