45 #include <QtCore/qglobal.h> 46 #include <QtCore/qsize.h> 47 #include <QtCore/qlist.h> 48 #include <QtGui/qpixmap.h> 63 enum Mode { Normal, Disabled, Active, Selected };
74 #ifdef Q_COMPILER_RVALUE_REFS 76 {
qSwap(
d, other.
d);
return *
this; }
84 {
return pixmap(
QSize(w, h), mode, state); }
86 {
return pixmap(
QSize(extent, extent), mode, state); }
94 { paint(painter,
QRect(x, y, w, h), alignment, mode, state); }
97 bool isDetached()
const;
100 int serialNumber()
const;
103 void addPixmap(
const QPixmap &pixmap,
Mode mode = Normal,
State state = Off);
109 static bool hasThemeIcon(
const QString &name);
112 static void setThemeSearchPaths(
const QStringList &searchpath);
115 static void setThemeName(
const QString &path);
119 enum Size { Small, Large, Automatic = Small };
120 static QT3_SUPPORT
void setPixmapSize(Size which,
const QSize &size);
121 static QT3_SUPPORT
QSize pixmapSize(Size which);
122 inline QT3_SUPPORT
void reset(
const QPixmap &pixmap, Size ) { *
this =
QIcon(pixmap); }
123 inline QT3_SUPPORT
void setPixmap(
const QPixmap &pixmap, Size,
Mode mode = Normal,
State state = Off)
124 { addPixmap(pixmap, mode, state); }
125 inline QT3_SUPPORT
void setPixmap(
const QString &fileName, Size,
Mode mode = Normal,
State state = Off)
126 { addPixmap(
QPixmap(fileName), mode, state); }
129 QT3_SUPPORT
QPixmap pixmap()
const;
136 #if !defined(QT_NO_DATASTREAM) 149 #if !defined(QT_NO_DATASTREAM) 155 typedef QIcon QIconSet;
The QVariant class acts like a union for the most common Qt data types.
The QPainter class performs low-level painting on widgets and other paint devices.
#define Q_DUMMY_COMPARISON_OPERATOR(C)
#define QT_END_NAMESPACE
This macro expands to.
Q_CORE_EXPORT QTextStream & reset(QTextStream &s)
Q_GUI_EXPORT QDataStream & operator>>(QDataStream &, QIcon &)
The QString class provides a Unicode character string.
#define Q_DECLARE_SHARED(TYPE)
QPixmap pixmap(int extent, Mode mode=Normal, State state=Off) const
Returns a pixmap of size QSize(extent, extent).
#define QT_BEGIN_NAMESPACE
This macro expands to.
void paint(QPainter *painter, int x, int y, int w, int h, Qt::Alignment alignment=Qt::AlignCenter, Mode mode=Normal, State state=Off) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Q_GUI_EXPORT QDataStream & operator<<(QDataStream &, const QIcon &)
Mode
This enum type describes the mode for which a pixmap is intended to be used.
The QStringList class provides a list of strings.
The State element defines configurations of objects and properties.
The QIconEngineV2 class provides an abstract base class for QIcon renderers.
void qSwap(T &value1, T &value2)
The QIconEngine class provides an abstract base class for QIcon renderers.
The QRect class defines a rectangle in the plane using integer precision.
QPixmap pixmap(int w, int h, Mode mode=Normal, State state=Off) const
Returns a pixmap of size QSize(w, h).
The QPixmap class is an off-screen image representation that can be used as a paint device...
Q_DECLARE_TYPEINFO(QIcon, Q_MOVABLE_TYPE)
The QSize class defines the size of a two-dimensional object using integer point precision.
void swap(QIcon &other)
Swaps icon other with this icon.
The QDataStream class provides serialization of binary data to a QIODevice.
static QString fileName(const QString &fileUrl)
static bool isNull(const QVariant::Private *d)
The QIcon class provides scalable icons in different modes and states.