Mercurial > trustbridge
annotate ui/certificatetabledelegate.h @ 1252:9a482182f80f
(issue54) Monitor update installation and restart afterwards on Linux
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Thu, 25 Sep 2014 15:57:25 +0200 |
parents | 78798d3af8f0 |
children | 2a1aa9df8f11 |
rev | line source |
---|---|
404 | 1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik |
2 * Software engineering by Intevation GmbH | |
3 * | |
4 * This file is Free Software under the GNU GPL (v>=2) | |
5 * and comes with ABSOLUTELY NO WARRANTY! | |
6 * See LICENSE.txt for details. | |
7 */ | |
347
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
8 #ifndef CERTIFICATETABLEDELEGATE_H |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
9 #define CERTIFICATETABLEDELEGATE_H |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
10 /** |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
11 * @file certificatetabledelegate.h |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
12 * @brief Item delegate drawing custom certificate items in table views. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 * |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
14 */ |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
15 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
16 #include <QStyledItemDelegate> |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
17 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
18 class CertificateTableDelegate : public QStyledItemDelegate |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 { |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
20 Q_OBJECT |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 public: |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
23 CertificateTableDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent){} |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
24 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
25 /** |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
26 * @brief Renders the delegate using the given painter and options. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 * |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
28 * @param painter The painter to draw the item. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
29 * @param option The style options. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
30 * @param index The model index of the item to draw. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
31 */ |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
32 void paint(QPainter *painter, const QStyleOptionViewItem &option, |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
33 const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
34 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
36 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
37 void setEditorData(QWidget *editor, const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
38 void setModelData(QWidget *editor, QAbstractItemModel *model, |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
39 const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
40 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
41 void updateEditorGeometry(QWidget *editor, |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
42 const QStyleOptionViewItem &option, const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
43 private: |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
44 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
45 /** |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
46 * @brief Draw the item using the given parameters. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
47 * |
1053
78798d3af8f0
Fixed doxygen build warnings.
Emanuel Schuetze <emanuel@intevation.de>
parents:
404
diff
changeset
|
48 * @param parent The parent widget. |
347
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
49 * @param option The style options. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
50 * @param index The model index of the item to draw. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
51 */ |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
52 QWidget *drawComboBox(QWidget *parent, const QStyleOptionViewItem &option, |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
53 const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
54 }; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
55 #endif |