Mercurial > trustbridge
annotate ui/certificateitemwidget.h @ 1234:ad4fc3649ffb
(issue146) Always draw certificate item buttons as unchecked
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Wed, 24 Sep 2014 16:25:27 +0200 |
parents | 6594e8e63a25 |
children | 2a1aa9df8f11 |
rev | line source |
---|---|
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
2 * Software engineering by Intevation GmbH |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
3 * |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
4 * This file is Free Software under the GNU GPL (v>=2) |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
6 * See LICENSE.txt for details. |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
7 */ |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
8 #ifndef CERTIFICATELISTITEM_H |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
9 #define CERTIFICATELISTITEM_H |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
10 /** |
1053
78798d3af8f0
Fixed doxygen build warnings.
Emanuel Schuetze <emanuel@intevation.de>
parents:
1011
diff
changeset
|
11 * @file certificateitemwidget.h |
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
12 * @brief Item delegate drawing custom certificate items in list views. |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
13 * |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
14 */ |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
15 #include <QWidget> |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
16 #include <QLabel> |
1234
ad4fc3649ffb
(issue146) Always draw certificate item buttons as unchecked
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1109
diff
changeset
|
17 #include <QToolButton> |
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
18 |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
19 #include "certificate.h" |
701
31c3d2bc9880
(Issue22) Fix painting problems with fixed size in windows style.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
687
diff
changeset
|
20 |
1234
ad4fc3649ffb
(issue146) Always draw certificate item buttons as unchecked
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1109
diff
changeset
|
21 class CheckLessToolBtn : public QToolButton |
ad4fc3649ffb
(issue146) Always draw certificate item buttons as unchecked
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1109
diff
changeset
|
22 { |
ad4fc3649ffb
(issue146) Always draw certificate item buttons as unchecked
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1109
diff
changeset
|
23 void paintEvent(QPaintEvent * pe); |
ad4fc3649ffb
(issue146) Always draw certificate item buttons as unchecked
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1109
diff
changeset
|
24 }; |
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
25 |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
26 class CertificateItemWidget : public QWidget |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
27 { |
627
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
28 Q_OBJECT |
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
29 public: |
638
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
30 CertificateItemWidget( |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
31 QWidget *parent = 0, |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
32 const Certificate &cert = Certificate(), |
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
33 bool state = false, |
1106
6f7b7d88f048
(issue115) Rework CertificateListWidgets to have a ToolButton instead of a combobox
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1101
diff
changeset
|
34 QToolButton * btn = NULL); |
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
35 |
627
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
36 bool state(); |
638
9d806f140bd5
Added state and editable flag to certificate list items.
Raimund Renkert <rrenkert@intevation.de>
parents:
627
diff
changeset
|
37 void setState(bool state); |
1108
9bb9932bb819
Revert commit 1101 the inactive manual changes were a bad idea
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1106
diff
changeset
|
38 Certificate certificate(); |
627
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
39 |
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
40 private: |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
41 void setupGUI(); |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
42 |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
43 Certificate mCertificate; |
1109
6594e8e63a25
(issue115) Add tooltips and fix manual changes handling
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1108
diff
changeset
|
44 bool mOriginalState; |
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
45 QLabel *mLabel; |
1106
6f7b7d88f048
(issue115) Rework CertificateListWidgets to have a ToolButton instead of a combobox
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1101
diff
changeset
|
46 QToolButton *mButton; |
627
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
47 |
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
48 private slots: |
1106
6f7b7d88f048
(issue115) Rework CertificateListWidgets to have a ToolButton instead of a combobox
Andre Heinecke <andre.heinecke@intevation.de>
parents:
1101
diff
changeset
|
49 void currentStateChanged(bool state); |
627
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
50 |
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
51 signals: |
566ee111e331
Added state to certificate list item and updated certificate list widget.
Raimund Renkert <rrenkert@intevation.de>
parents:
582
diff
changeset
|
52 void stateChanged(bool state, const Certificate &cert); |
582
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
53 }; |
88c9bdc74175
New widgets to display certificates in lists.
Raimund Renkert <rrenkert@intevation.de>
parents:
diff
changeset
|
54 #endif |