| 145 |
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 |
|
| 111 |
david |
14 |
#ifndef TIMEDELEGATE_H
|
|
|
15 |
#define TIMEDELEGATE_H
|
|
|
16 |
|
| 161 |
david |
17 |
#include <QStyledItemDelegate>
|
| 111 |
david |
18 |
#include <QModelIndex>
|
|
|
19 |
#include <QObject>
|
|
|
20 |
#include <QSize>
|
|
|
21 |
#include <QTimeEdit>
|
|
|
22 |
|
| 161 |
david |
23 |
class timeDelegate : public QStyledItemDelegate
|
| 111 |
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,
|
|
|
38 |
const QStyleOptionViewItem &option, const QModelIndex &index) const;
|
| 161 |
david |
39 |
|
|
|
40 |
QString displayText ( const QVariant & value, const QLocale & locale ) const;
|
| 111 |
david |
41 |
};
|
|
|
42 |
|
|
|
43 |
#endif // TIMEDELEGATE_H
|