QIcon Class Reference

#include <qicon.h>

Class Description

Definition at line 60 of file qicon.h.

Public Types

enum  Mode { Normal, Disabled, Active, Selected }
 
enum  State { On, Off }
 
typedef QIconPrivate * DataPtr
 

Public Member Functions

 QIcon ()
 
 QIcon (const QPixmap &pixmap)
 
 QIcon (const QIcon &other)
 
 QIcon (const QString &fileName)
 
 QIcon (QIconEngine *engine)
 
 QIcon (QIconEngineV2 *engine)
 
 ~QIcon ()
 
QIconoperator= (const QIcon &other)
 
void swap (QIcon &other)
 
 operator QVariant () const
 
QPixmap pixmap (const QSize &size, Mode mode=Normal, State state=Off) const
 
QPixmap pixmap (int w, int h, Mode mode=Normal, State state=Off) const
 
QPixmap pixmap (int extent, Mode mode=Normal, State state=Off) const
 
QSize actualSize (const QSize &size, Mode mode=Normal, State state=Off) const
 
QString name () const
 
void paint (QPainter *painter, const QRect &rect, Qt::Alignment alignment=Qt::AlignCenter, Mode mode=Normal, State state=Off) const
 
void paint (QPainter *painter, int x, int y, int w, int h, Qt::Alignment alignment=Qt::AlignCenter, Mode mode=Normal, State state=Off) const
 
bool isNull () const
 
bool isDetached () const
 
void detach ()
 
int serialNumber () const
 
qint64 cacheKey () const
 
void addPixmap (const QPixmap &pixmap, Mode mode=Normal, State state=Off)
 
void addFile (const QString &fileName, const QSize &size=QSize(), Mode mode=Normal, State state=Off)
 
QList< QSizeavailableSizes (Mode mode=Normal, State state=Off) const
 
DataPtrdata_ptr ()
 

Static Public Member Functions

static QIcon fromTheme (const QString &name, const QIcon &fallback=QIcon())
 
static bool hasThemeIcon (const QString &name)
 
static QStringList themeSearchPaths ()
 
static void setThemeSearchPaths (const QStringList &searchpath)
 
static QString themeName ()
 
static void setThemeName (const QString &path)
 

Friends

Q_GUI_EXPORT QDataStreamoperator<< (QDataStream &, const QIcon &)
 
Q_GUI_EXPORT QDataStreamoperator>> (QDataStream &, QIcon &)
 

Member Typedef Documentation

typedef QIconPrivate* DataPtr

Definition at line 142 of file qicon.h.

Member Enumeration Documentation

enum Mode
Enumerator
Normal 
Disabled 
Active 
Selected 

Definition at line 63 of file qicon.h.

enum State
Enumerator
On 
Off 

Definition at line 64 of file qicon.h.

64 { On, Off };

Constructor & Destructor Documentation

QIcon ( )
QIcon ( const QPixmap pixmap)
QIcon ( const QIcon other)
QIcon ( const QString fileName)
explicit
QIcon ( QIconEngine engine)
explicit
QIcon ( QIconEngineV2 engine)
explicit
~QIcon ( )

Member Function Documentation

QIcon& operator= ( const QIcon other)
void swap ( QIcon other)
inline

Definition at line 78 of file qicon.h.

78 { qSwap(d, other.d); }
Q_INLINE_TEMPLATE void qSwap(QScopedPointer< T, Cleanup > &p1, QScopedPointer< T, Cleanup > &p2)
operator QVariant ( ) const
QPixmap pixmap ( const QSize size,
Mode  mode = Normal,
State  state = Off 
) const
QPixmap pixmap ( int  w,
int  h,
Mode  mode = Normal,
State  state = Off 
) const
inline

Definition at line 83 of file qicon.h.

84  { return pixmap(QSize(w, h), mode, state); }
GLint mode
Definition: GLee.h:4479
QPixmap pixmap(const QSize &size, Mode mode=Normal, State state=Off) const
int int int int int int h
Definition: GLee.h:10534
Definition: qsize.h:53
GLubyte GLubyte GLubyte GLubyte w
Definition: GLee.h:1775
QPixmap pixmap ( int  extent,
Mode  mode = Normal,
State  state = Off 
) const
inline

Definition at line 85 of file qicon.h.

86  { return pixmap(QSize(extent, extent), mode, state); }
GLint mode
Definition: GLee.h:4479
QPixmap pixmap(const QSize &size, Mode mode=Normal, State state=Off) const
Definition: qsize.h:53
QSize actualSize ( const QSize size,
Mode  mode = Normal,
State  state = Off 
) const
QString name ( ) const
void paint ( QPainter painter,
const QRect rect,
Qt::Alignment  alignment = Qt::AlignCenter,
Mode  mode = Normal,
State  state = Off 
) const
void paint ( QPainter painter,
int  x,
int  y,
int  w,
int  h,
Qt::Alignment  alignment = Qt::AlignCenter,
Mode  mode = Normal,
State  state = Off 
) const
inline

Definition at line 93 of file qicon.h.

94  { paint(painter, QRect(x, y, w, h), alignment, mode, state); }
GLenum GLint GLint y
Definition: GLee.h:876
GLint mode
Definition: GLee.h:4479
void paint(QPainter *painter, const QRect &rect, Qt::Alignment alignment=Qt::AlignCenter, Mode mode=Normal, State state=Off) const
GLenum GLint x
Definition: GLee.h:876
Definition: qrect.h:58
int int int int int int h
Definition: GLee.h:10534
GLubyte GLubyte GLubyte GLubyte w
Definition: GLee.h:1775
bool isNull ( ) const
bool isDetached ( ) const
void detach ( )
int serialNumber ( ) const
qint64 cacheKey ( ) const
void addPixmap ( const QPixmap pixmap,
Mode  mode = Normal,
State  state = Off 
)
void addFile ( const QString fileName,
const QSize size = QSize(),
Mode  mode = Normal,
State  state = Off 
)
QList<QSize> availableSizes ( Mode  mode = Normal,
State  state = Off 
) const
static QIcon fromTheme ( const QString name,
const QIcon fallback = QIcon() 
)
static
static bool hasThemeIcon ( const QString name)
static
static QStringList themeSearchPaths ( )
static
static void setThemeSearchPaths ( const QStringList searchpath)
static
static QString themeName ( )
static
static void setThemeName ( const QString path)
static
DataPtr& data_ptr ( )
inline

Definition at line 143 of file qicon.h.

143 { return d; }

Friends And Related Function Documentation

Q_GUI_EXPORT QDataStream& operator<< ( QDataStream ,
const QIcon  
)
friend
Q_GUI_EXPORT QDataStream& operator>> ( QDataStream ,
QIcon  
)
friend

The documentation for this class was generated from the following file: