Subversion Repositories svn1

Rev

Rev 157 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
141 david 1
/*============================================================================
2
**
3
**  Project/Product : 
4
**  Filename        : timedelegate.h
5
**  Author(s)       : DDP
6
**
7
**  Description     : A delgated widget to assist in the editing of time items
8
**                    within a table
9
**
10
**
11
***==========================================================================*/
12
 
13
 
107 david 14
#ifndef TIMEDELEGATE_H
15
#define TIMEDELEGATE_H
16
 
157 david 17
#include <QStyledItemDelegate>
107 david 18
#include <QModelIndex>
19
#include <QObject>
20
#include <QSize>
21
#include <QTimeEdit>
22
 
157 david 23
class timeDelegate : public QStyledItemDelegate
107 david 24
{
25
    Q_OBJECT
26
 
27
public:
28
    timeDelegate(QObject *parent = 0);
29
 
30
    QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
31
                          const QModelIndex &index) const;
32
 
33
    void setEditorData(QWidget *editor, const QModelIndex &index) const;
34
    void setModelData(QWidget *editor, QAbstractItemModel *model,
35
                      const QModelIndex &index) const;
36
 
37
    void updateEditorGeometry(QWidget *editor,
380 david 38
                              const QStyleOptionViewItem &option, const QModelIndex &index) const;
157 david 39
 
40
    QString displayText ( const QVariant & value, const QLocale & locale ) const;
107 david 41
};
42
 
43
#endif // TIMEDELEGATE_H