Obsolete Members for QIcon

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

Public Functions

(obsolete) QPixmap pixmap(QWindow *window, const QSize &size, QIcon::Mode mode = Normal, QIcon::State state = Off) const

Member Function Documentation

[since 5.1] QPixmap QIcon::pixmap(QWindow *window, const QSize &size, QIcon::Mode mode = Normal, QIcon::State state = Off) const

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

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.

Use the overload which takes qreal devicePixelRatio instead.

This function was introduced in Qt 5.1.

See also actualSize() and paint().

© 2021 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.