comparison ui/certificateitemdelegate.h @ 266:dd6a09d2699f

Added delegate for certificate list items to render a custom ui.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 02 Apr 2014 09:26:38 +0200
parents
children abac76b855b2
comparison
equal deleted inserted replaced
265:ffd47b045d19 266:dd6a09d2699f
1
2 #ifndef CERTIFICATELISTITEM_H
3 #define CERTIFICATELISTITEM_H
4 /**
5 * @file certificateitemdelegate.h
6 * @brief Item delegate drawing custom certificate items in list views.
7 *
8 */
9
10 #include <QStyledItemDelegate>
11
12 class CertificateItemDelegate : public QStyledItemDelegate
13 {
14 Q_OBJECT
15
16 public:
17 CertificateItemDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent){}
18
19 /**
20 * @brief Renders the delegate using the given painter and options.
21 *
22 * @param painter The painter to draw the item.
23 * @param option The style options.
24 * @param index The model index of the item to draw.
25 */
26 void paint(QPainter *painter, const QStyleOptionViewItem &option,
27 const QModelIndex &index) const;
28
29 private:
30
31 /**
32 * @brief Draw the item using the given parameters.
33 *
34 * @param painter The painter to draw the item.
35 * @param option The style options.
36 * @param index The model index of the item to draw.
37 * @param icon The icon to display.
38 * @param font The font used to draw text.
39 */
40 void drawItem(QPainter *painter, const QStyleOptionViewItem &option,
41 const QModelIndex &index, QIcon *icon, QFont *font) const;
42 };
43 #endif

http://wald.intevation.org/projects/trustbridge/