Mercurial > trustbridge
annotate ui/certificatetabledelegate.h @ 1395:a2574a029322
Fix Base 64 signature size calculation.
If the signature byte size is not equally dividable
by three the base 64 encoding needs three additional bytes.
The value is now fixed to avoid such errors in the future.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Mon, 26 Jan 2015 13:17:32 +0100 |
parents | 2a1aa9df8f11 |
children |
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 |
1255
2a1aa9df8f11
(issue133) Improve API documentation
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1053
diff
changeset
|
18 /** @brief Item delegate drawing custom certificate items in table views.*/ |
347
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 class CertificateTableDelegate : public QStyledItemDelegate |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
20 { |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
21 Q_OBJECT |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
22 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
23 public: |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
24 CertificateTableDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent){} |
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 /** |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 * @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
|
28 * |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
29 * @param painter The painter to draw the item. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
30 * @param option The style options. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
31 * @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
|
32 */ |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
33 void paint(QPainter *painter, const QStyleOptionViewItem &option, |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
34 const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
36 const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
37 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
38 void setEditorData(QWidget *editor, const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
39 void setModelData(QWidget *editor, QAbstractItemModel *model, |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
40 const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
41 |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
42 void updateEditorGeometry(QWidget *editor, |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
43 const QStyleOptionViewItem &option, const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
44 private: |
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 /** |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
47 * @brief Draw the item using the given parameters. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
48 * |
1053
78798d3af8f0
Fixed doxygen build warnings.
Emanuel Schuetze <emanuel@intevation.de>
parents:
404
diff
changeset
|
49 * @param parent The parent widget. |
347
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
50 * @param option The style options. |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
51 * @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
|
52 */ |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
53 QWidget *drawComboBox(QWidget *parent, const QStyleOptionViewItem &option, |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
54 const QModelIndex &index) const; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
55 }; |
dde533ba4fcc
Added table item delegate for certificates.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
56 #endif |