Mercurial > trustbridge
annotate ui/separatoritemdelegate.h @ 377:e3f825a7257e
merged.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Tue, 15 Apr 2014 12:34:04 +0200 |
parents | b6c2fa8457b6 |
children | 17e1c8f37d72 |
rev | line source |
---|---|
273
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
1 #ifndef SEPARATORITEMDELEGATE_H |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
2 #define SEPARATORITEMDELEGATE_H |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
3 /** |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
4 * @file separatoritemdelegate.h |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
5 * @brief Item delegate drawing a separator in list widgets. |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
6 * |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
7 */ |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
8 |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
9 #include <QStyledItemDelegate> |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
10 |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
11 class SeparatorItemDelegate : public QStyledItemDelegate |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
12 { |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 Q_OBJECT |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
14 |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
15 public: |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
16 SeparatorItemDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent){} |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
17 |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
18 /** |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 * @brief Renders the delegate using the given painter and options. |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
20 * |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 * @param painter The painter to draw the item. |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 * @param option The style options. |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
23 * @param index The model index of the item to draw. |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
24 */ |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
25 void paint(QPainter *painter, const QStyleOptionViewItem &option, |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
26 const QModelIndex &index) const; |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 }; |
b6c2fa8457b6
Added new list item delegate for drawing a separator.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
28 #endif |