comparison ui/textoverlaybutton.h @ 722:b0929968562a

(Issue31) Add textoverlaybutton to show a text in the button.
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 02 Jul 2014 18:35:30 +0200
parents
children 57371f2e8dae
comparison
equal deleted inserted replaced
721:abc76948d8e5 722:b0929968562a
1 #ifndef UI_TEXTOVERLAYBUTTON_H
2 #define UI_TEXTOVERLAYBUTTON_H
3 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
4 * Software engineering by Intevation GmbH
5 *
6 * This file is Free Software under the GNU GPL (v>=2)
7 * and comes with ABSOLUTELY NO WARRANTY!
8 * See LICENSE.txt for details.
9 */
10
11 /** @file A tool button that overlays a text over the icon */
12
13 #include <QToolButton>
14 #include <QString>
15
16 class QPaintEvent;
17
18 class TextOverlayButton : public QToolButton
19 {
20 Q_OBJECT
21
22 public:
23 QString overlay() {return mOverlay;}
24
25 protected:
26 virtual void paintEvent(QPaintEvent *);
27
28 public slots:
29 void setOverlay (const QString& text) {mOverlay = text; repaint();}
30
31 private:
32 QString mOverlay;
33 };
34
35 #endif // UI_TEXTOVERLAYBUTTON_H

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