Subversion Repositories svn1-original

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
145 david 1
/*============================================================================
111 david 2
**
145 david 3
**  Project/Product : 
4
**  Filename        : spinboxdelegate.h
5
**  Author(s)       : DDP
111 david 6
**
145 david 7
**  Description     : A delgated widget to assist in the editing of time items
8
**                    within a table
111 david 9
**
10
**
145 david 11
***==========================================================================*/
111 david 12
 
145 david 13
#ifndef SPINDELEGATE_H
14
#define SPINDELEGATE_H
111 david 15
 
16
#include <QItemDelegate>
17
#include <QModelIndex>
18
#include <QObject>
19
#include <QSize>
20
#include <QSpinBox>
21
 
22
class SpinBoxDelegate : public QItemDelegate
23
{
24
    Q_OBJECT
25
 
26
public:
114 - 27
    SpinBoxDelegate(int minvalue = 0, int maxvalue = 0, QObject *parent = 0);
111 david 28
 
29
    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
30
                          const QModelIndex &index) const;
31
 
114 - 32
    int min_value;
33
    int max_value;
34
 
111 david 35
    void setEditorData(QWidget *editor, const QModelIndex &index) const;
36
    void setModelData(QWidget *editor, QAbstractItemModel *model,
37
                      const QModelIndex &index) const;
38
 
39
    void updateEditorGeometry(QWidget *editor,
40
        const QStyleOptionViewItem &option, const QModelIndex &index) const;
41
};
42
 
43
#endif