2
* iconwidget.h - misc. Iconset- and Icon-aware widgets
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
25
#include <qpushbutton.h>
26
#include <qtoolbutton.h>
33
class IconsetSelectItem;
35
class IconsetSelect : public QListBox
39
IconsetSelect(QWidget *parent = 0, const char *name = 0);
42
void insert(const Iconset &); // iconsets must be inserted in following order: most prioritent first
44
const Iconset *iconset() const;
54
void paintCell(QPainter *p, int row, int col);
56
friend class IconsetSelectItem;
59
class IconWidgetItem : public QObject, public QListBoxItem
63
IconWidgetItem(QListBox *parent = 0, QListBoxItem *after = 0)
64
: QListBoxItem(parent, after) {}
66
virtual const Iconset *iconset() const { return 0; }
69
class IconsetDisplayItem;
71
class IconsetDisplay : public QListBox
75
IconsetDisplay(QWidget *parent = 0, const char *name = 0);
78
void setIconset(const Iconset &);
83
void paintCell(QPainter *p, int row, int col);
85
friend class IconsetDisplayItem;
88
class IconButton : public QPushButton
91
Q_PROPERTY( QString iconName READ iconName WRITE setIcon )
92
Q_PROPERTY( bool textVisible READ textVisible WRITE setTextVisible )
94
Q_OVERRIDE( QPixmap pixmap DESIGNABLE false SCRIPTABLE false )
95
Q_OVERRIDE( QIconSet iconSet DESIGNABLE false SCRIPTABLE false )
98
IconButton(QWidget *parent = 0, const char *name = 0);
101
void setIcon(const QPixmap &);
104
void setIcon(const Icon *, bool activate = true);
105
void forceSetIcon(const Icon *, bool activate = true);
106
void setIcon(const QString &);
107
const QString &iconName() const;
109
void setText(const QString &);
111
bool textVisible() const;
112
void setTextVisible(bool);
119
virtual void drawButtonLabel(QPainter *p);
122
class IconToolButton : public QToolButton
125
Q_PROPERTY( QString iconName READ iconName WRITE setIcon )
127
Q_OVERRIDE( QPixmap pixmap DESIGNABLE false SCRIPTABLE false )
128
Q_OVERRIDE( QIconSet iconSet DESIGNABLE false SCRIPTABLE false )
131
IconToolButton(QWidget *parent = 0, const char *name = 0);
134
void setIcon(const QPixmap &);
137
void setIcon(const Icon *, bool activate = true);
138
void setIcon(const QString &);
139
const QString &iconName() const;
146
void drawButtonLabel(QPainter *p);