- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions | Friends

# QIcon Class Reference

Search for all occurrences

## Detailed Description

Definition at line 60 of file qicon.h.

`#include <qicon.h>`

List of all members.

## 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 ()
QIcon & | operator= (const 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< QSize > | availableSizes (Mode mode=Normal, State state=Off) const
DataPtr & | data_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 QDataStream & | operator<< (QDataStream &, const QIcon &)
Q_GUI_EXPORT QDataStream & | operator>> (QDataStream &, QIcon &)

## Member Typedef Documentation

typedef QIconPrivate* DataPtr

Search for all occurrences

Definition at line 136 of file qicon.h.

## Member Enumeration Documentation

enum Mode

Search for all occurrences

Enumerator:

  Normal | Search for all occurrences
  Disabled | Search for all occurrences
  Active | Search for all occurrences
  Selected | Search for all occurrences

Definition at line 63 of file qicon.h.

    { Normal, Disabled, Active, Selected };

enum State

Search for all occurrences

Enumerator:

  On | Search for all occurrences
  Off | Search for all occurrences

Definition at line 64 of file qicon.h.

    { 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 | ) |

operator QVariant | ( |  | ) | const

QPixmap pixmap | ( | const QSize & | size,
|  | Mode | mode = `Normal`,
|  | State | state = `Off`
| ) |  | const

Search for all occurrences

QPixmap pixmap | ( | int | w,
|  | int | h,
|  | Mode | mode = `Normal`,
|  | State | state = `Off`
| ) |  | const `[inline]`

Search for all occurrences

Definition at line 77 of file qicon.h.

            { return pixmap(QSize(w, h), mode, state); }

QPixmap pixmap | ( | int | extent,
|  | Mode | mode = `Normal`,
|  | State | state = `Off`
| ) |  | const `[inline]`

Search for all occurrences

Definition at line 79 of file qicon.h.

            { return pixmap(QSize(extent, extent), mode, state); }

QSize actualSize | ( | const QSize & | size,
|  | Mode | mode = `Normal`,
|  | State | state = `Off`
| ) |  | const

Search for all occurrences

QString name | ( |  | ) | const

Search for all occurrences

void paint | ( | QPainter * | painter,
|  | const QRect & | rect,
|  | Qt::Alignment | alignment = `Qt::AlignCenter`,
|  | Mode | mode = `Normal`,
|  | State | state = `Off`
| ) |  | const

Search for all occurrences

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]`

Search for all occurrences

Definition at line 87 of file qicon.h.

            { paint(painter, QRect(x, y, w, h), alignment, mode, state); }

bool isNull | ( |  | ) | const

Search for all occurrences

bool isDetached | ( |  | ) | const

Search for all occurrences

void detach | ( |  | ) |

Search for all occurrences

int serialNumber | ( |  | ) | const

Search for all occurrences

qint64 cacheKey | ( |  | ) | const

Search for all occurrences

void addPixmap | ( | const QPixmap & | pixmap,
|  | Mode | mode = `Normal`,
|  | State | state = `Off`
| ) |  |

Search for all occurrences

void addFile | ( | const QString & | fileName,
|  | const QSize & | size = `QSize()`,
|  | Mode | mode = `Normal`,
|  | State | state = `Off`
| ) |  |

Search for all occurrences

QList<QSize> availableSizes | ( | Mode | mode = `Normal`,
|  | State | state = `Off`
| ) |  | const

Search for all occurrences

static QIcon fromTheme | ( | const QString & | name,
|  | const QIcon & | fallback = `QIcon()`
| ) |  | `[static]`

Search for all occurrences

static bool hasThemeIcon | ( | const QString & | name | ) | `[static]`

Search for all occurrences

static QStringList themeSearchPaths | ( |  | ) | `[static]`

Search for all occurrences

static void setThemeSearchPaths | ( | const QStringList & | searchpath | ) | `[static]`

Search for all occurrences

static QString themeName | ( |  | ) | `[static]`

Search for all occurrences

static void setThemeName | ( | const QString & | path | ) | `[static]`

Search for all occurrences

DataPtr& data_ptr | ( |  | ) | `[inline]`

Search for all occurrences

Definition at line 137 of file qicon.h.

    { 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:

- QtGui/qicon.h

QIcon QIcon QIcon QIcon QIcon QIcon QIcon QIcon QIcon QIcon
QIcon QIcon QIcon QIcon QIcon QIcon QIcon QIcon QIcon QIcon