Doc: Add basic info about icon engines to QIcon

Some of the function doc refers to icon engines, but the concept was
never properly introduced. Also explains why order of adding icon
files matter.

Task-number: QTBUG-125772
Change-Id: I342d3d90e3cb58f0c12b205a226aaf78b2136dac
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 17bf4cd98084ff882bdddb1bd55a9ee52613b4bd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Eirik Aavitsland 2024-07-01 10:34:36 +02:00 committed by Qt Cherry-pick Bot
parent 4b7ad06dc4
commit a6e399251a

View File

@ -625,11 +625,26 @@ QFactoryLoader *qt_iconEngineFactoryLoader()
Icons from an application-provided theme take precedence over the
native icon library.
In addition, it is possible to provide custom \l {QIconEngine}
{icon engines}. This allows applications to customize every aspect
of generated icons. With QIconEnginePlugin it is possible to register
different icon engines for different file suffixes, making it possible
for third parties to provide additional icon engines to those included
\section1 Icon Engines
Internally, QIcon instantiates an \l {QIconEngine} {icon engine}
backend to handle and render the icon images. The type of icon
engine is determined by the first file or pixmap or theme added to a
QIcon object. Additional files or pixmaps will then be handled by
the same engine.
Icon engines differ in the way they handle and render icons. The
default pixmap-based engine only deals with fixed images, while the
QtSvg module provides an icon engine that can re-render the provided
vector graphics files at the requested size for better quality. The
theme icon engines will typically only provide images from native
platform icon library, and ignore any added files or pixmaps.
In addition, it is possible to provide custom icon engines. This
allows applications to customize every aspect of generated
icons. With QIconEnginePlugin it is possible to register different
icon engines for different file suffixes, making it possible for
third parties to provide additional icon engines to those included
with Qt.
\section1 Making Classes that Use QIcon