2
* fancylabel.h - the FancyLabel widget
3
* Copyright (C) 2003 Michail Pishchagin
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Lesser General Public
7
* License as published by the Free Software Foundation; either
8
* version 2.1 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Lesser General Public License for more details.
15
* You should have received a copy of the GNU Lesser General Public
16
* License along with this library; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31
class FancyLabel : public QWidget
34
Q_PROPERTY( QPixmap pixmap READ pixmap WRITE setPixmap )
35
Q_PROPERTY( QString text READ text WRITE setText )
36
Q_PROPERTY( QString help READ help WRITE setHelp )
37
Q_PROPERTY( QColor colorFrom READ colorFrom WRITE setColorFrom )
38
Q_PROPERTY( QColor colorTo READ colorTo WRITE setColorTo )
39
Q_PROPERTY( QColor colorFont READ colorFont WRITE setColorFont )
40
Q_PROPERTY( QString iconName READ iconName WRITE setIcon )
42
Q_ENUMS( Shape Shadow )
43
Q_PROPERTY( Shape frameShape READ frameShape WRITE setFrameShape )
44
Q_PROPERTY( Shadow frameShadow READ frameShadow WRITE setFrameShadow )
45
Q_PROPERTY( int lineWidth READ lineWidth WRITE setLineWidth )
46
Q_PROPERTY( int midLineWidth READ midLineWidth WRITE setMidLineWidth )
49
FancyLabel (QWidget *parent = 0, const char *name = 0);
52
const QString &text () const;
53
const QString &help () const;
54
const QPixmap *pixmap () const;
55
const QColor &colorFrom () const;
56
const QColor &colorTo () const;
57
const QColor &colorFont () const;
58
const Icon *icon () const;
59
const QString &iconName () const;
60
void setText (const QString &);
61
void setHelp (const QString &);
62
void setPixmap (const QPixmap &);
63
void setColorFrom (const QColor &);
64
void setColorTo (const QColor &);
65
void setColorFont (const QColor &);
66
void setIcon (const Icon *);
67
void setIcon (const QString &);
68
void setIcon (const QPixmap &);
70
enum Shape { NoFrame = 0, // no frame
71
Box = 0x0001, // rectangular box
72
Panel = 0x0002, // rectangular panel
73
WinPanel = 0x0003, // rectangular panel (Windows)
74
StyledPanel = 0x0006, // rectangular panel depending on the GUI style
75
PopupPanel = 0x0007, // rectangular panel depending on the GUI style
76
MenuBarPanel = 0x0008,
77
ToolBarPanel = 0x0009,
78
LineEditPanel = 0x000a,
79
TabWidgetPanel = 0x000b,
80
GroupBoxPanel = 0x000c,
81
MShape = 0x000f // mask for the shape
83
enum Shadow { Plain = 0x0010, // plain line
84
Raised = 0x0020, // raised shadow effect
85
Sunken = 0x0030, // sunken shadow effect
86
MShadow = 0x00f0 }; // mask for the shadow
88
Shape frameShape () const;
89
void setFrameShape (Shape);
91
Shadow frameShadow () const;
92
void setFrameShadow (Shadow);
94
int lineWidth () const;
95
void setLineWidth (int);
97
int midLineWidth () const;
98
void setMidLineWidth (int);
100
void setScaledContents(int width, int height);
101
static void setSmallFontSize(int);
108
class IconLabel : public QLabel
111
Q_PROPERTY( QString iconName READ iconName WRITE setIcon )
114
IconLabel(QWidget *parent = 0, const char *name = 0);
117
const Icon *icon () const;
118
const QString &iconName () const;
119
void setIcon (const Icon *, bool copyIcon = true);
120
void setIcon (const QString &);
121
void setIcon (const QPixmap &);
123
void setScaledContents(int width, int height);
127
void drawContents (QPainter *paint);