- Qt 6.9
- Qt GUI
- C++ Classes
- QIcon
- Qt 6.9.1 Reference Documentation

# Obsolete Members for QIcon

The following members of class QIcon are deprecated. They are provided to keep old source code working. We strongly advise against using them in new code.

## Public Functions

`(deprecated in 6.0)` QSize | actualSize(QWindow *window, const QSize &size, QIcon::Mode mode = Normal, QIcon::State state = Off) const
`(deprecated in 6.0)` QPixmap | pixmap(QWindow *window, const QSize &size, QIcon::Mode mode = Normal, QIcon::State state = Off) const

## Member Function Documentation

### `[deprecated in 6.0]` QSize QIcon::actualSize(QWindow *window, const QSize &size, QIcon::Mode mode = Normal, QIcon::State state = Off) const

This function is deprecated since 6.0. We strongly advise against using it in new code.

Use actualSize(size) instead.

Returns the actual size of the icon for the requested window size, mode, and state.

The pixmap can be smaller than the requested size. The returned size is in device-independent pixels (This is relevant for high-dpi pixmaps.)

See also actualSize(), pixmap(), and paint().

### `[deprecated in 6.0]` QPixmap QIcon::pixmap(QWindow *window, const QSize &size, QIcon::Mode mode = Normal, QIcon::State state = Off) const

This function is deprecated since 6.0. We strongly advise against using it in new code.

Use pixmap(size, devicePixelRatio) instead.

Returns a pixmap with the requested window size, mode, and state, generating one if necessary.

The pixmap can be smaller than the requested size. If window is on a high-dpi display the pixmap can be larger. In that case it will have a devicePixelRatio larger than 1.

See also actualSize() and paint().