Mercurial > trustbridge
comparison ui/certificatetabledelegate.h @ 347:dde533ba4fcc
Added table item delegate for certificates.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 10 Apr 2014 14:13:34 +0200 |
parents | |
children | 17e1c8f37d72 |
comparison
equal
deleted
inserted
replaced
346:a54925d41056 | 347:dde533ba4fcc |
---|---|
1 #ifndef CERTIFICATETABLEDELEGATE_H | |
2 #define CERTIFICATETABLEDELEGATE_H | |
3 /** | |
4 * @file certificatetabledelegate.h | |
5 * @brief Item delegate drawing custom certificate items in table views. | |
6 * | |
7 */ | |
8 | |
9 #include <QStyledItemDelegate> | |
10 | |
11 class CertificateTableDelegate : public QStyledItemDelegate | |
12 { | |
13 Q_OBJECT | |
14 | |
15 public: | |
16 CertificateTableDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent){} | |
17 | |
18 /** | |
19 * @brief Renders the delegate using the given painter and options. | |
20 * | |
21 * @param painter The painter to draw the item. | |
22 * @param option The style options. | |
23 * @param index The model index of the item to draw. | |
24 */ | |
25 void paint(QPainter *painter, const QStyleOptionViewItem &option, | |
26 const QModelIndex &index) const; | |
27 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, | |
28 const QModelIndex &index) const; | |
29 | |
30 void setEditorData(QWidget *editor, const QModelIndex &index) const; | |
31 void setModelData(QWidget *editor, QAbstractItemModel *model, | |
32 const QModelIndex &index) const; | |
33 | |
34 void updateEditorGeometry(QWidget *editor, | |
35 const QStyleOptionViewItem &option, const QModelIndex &index) const; | |
36 private: | |
37 | |
38 /** | |
39 * @brief Draw the item using the given parameters. | |
40 * | |
41 * @param painter The painter to draw the item. | |
42 * @param option The style options. | |
43 * @param index The model index of the item to draw. | |
44 * @param icon The icon to display. | |
45 * @param font The font used to draw text. | |
46 */ | |
47 QWidget *drawComboBox(QWidget *parent, const QStyleOptionViewItem &option, | |
48 const QModelIndex &index) const; | |
49 }; | |
50 #endif |