annotate ui/textoverlaybutton.h @ 1255:2a1aa9df8f11

(issue133) Improve API documentation
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 25 Sep 2014 17:58:12 +0200
parents 78798d3af8f0
children
rev   line source
722
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
1 #ifndef UI_TEXTOVERLAYBUTTON_H
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
2 #define UI_TEXTOVERLAYBUTTON_H
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
3 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
4 * Software engineering by Intevation GmbH
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
5 *
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
6 * This file is Free Software under the GNU GPL (v>=2)
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
7 * and comes with ABSOLUTELY NO WARRANTY!
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
8 * See LICENSE.txt for details.
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
9 */
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
10
1255
2a1aa9df8f11 (issue133) Improve API documentation
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1053
diff changeset
11 /**
1053
78798d3af8f0 Fixed doxygen build warnings.
Emanuel Schuetze <emanuel@intevation.de>
parents: 932
diff changeset
12 * @file textoverlaybutton.h
78798d3af8f0 Fixed doxygen build warnings.
Emanuel Schuetze <emanuel@intevation.de>
parents: 932
diff changeset
13 * @brief A tool button that overlays a text over the icon.
78798d3af8f0 Fixed doxygen build warnings.
Emanuel Schuetze <emanuel@intevation.de>
parents: 932
diff changeset
14 */
722
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
15
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
16 #include <QToolButton>
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
17 #include <QString>
932
57371f2e8dae (issue72) Set background image as pixmap in textoverlayicon
Andre Heinecke <andre.heinecke@intevation.de>
parents: 722
diff changeset
18 #include <QPixmap>
722
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
19
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
20 class QPaintEvent;
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
21
1255
2a1aa9df8f11 (issue133) Improve API documentation
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1053
diff changeset
22 /** @brief A tool button that overlays a text over the icon.
2a1aa9df8f11 (issue133) Improve API documentation
Andre Heinecke <andre.heinecke@intevation.de>
parents: 1053
diff changeset
23 */
722
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
24 class TextOverlayButton : public QToolButton
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
25 {
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
26 Q_OBJECT
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
27
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
28 public:
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
29 QString overlay() {return mOverlay;}
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
30
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
31 protected:
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
32 virtual void paintEvent(QPaintEvent *);
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
33
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
34 public slots:
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
35 void setOverlay (const QString& text) {mOverlay = text; repaint();}
932
57371f2e8dae (issue72) Set background image as pixmap in textoverlayicon
Andre Heinecke <andre.heinecke@intevation.de>
parents: 722
diff changeset
36 void setBackgroundIcon (const QString& iconPath);
722
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
37
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
38 private:
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
39 QString mOverlay;
932
57371f2e8dae (issue72) Set background image as pixmap in textoverlayicon
Andre Heinecke <andre.heinecke@intevation.de>
parents: 722
diff changeset
40 QPixmap mBackground;
722
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
41 };
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
42
b0929968562a (Issue31) Add textoverlaybutton to show a text in the button.
Andre Heinecke <andre.heinecke@intevation.de>
parents:
diff changeset
43 #endif // UI_TEXTOVERLAYBUTTON_H

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