qt6-bb10/tests/auto/gui/image/qicon
Volker Hilsheimer 87896c03c1 QIcon: enable icon engine plugins to implement themes
So far, the keys of icon engine plugins were only interpreted as the
suffix of icon files, loaded via QIcon(filename). However, an icon
engine could provide a lot more flexibility if it could implement an
entire theme.

Match the list of keys a plugin can register itself with also against
the current theme name. If a matching plugin is found, use that plugin
to create the icon engine. Store the factory from the plugin to avoid
costly lookups for each icon.

Extend the QIcon test case by adding a custom plugin that supports two
themes. Since the plugin and icon engine creation infrastructure
doesn't communicate which theme the plugin was created for, use
QIcon::themeName to record the current theme when the engine gets
created.

[ChangeLog][QtGui][QIconEnginePlugin] The keys registered by an
QIconEnginePlugin implementation are now also matched against the
current theme (system or user theme), allowing engine providers
to implement entire themes through a plugin.

Change-Id: I8a5e30ff8b5bb7c78b5204e82760e4328671e4c1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-30 02:36:04 +02:00
..
fallback_icons
icons Consult QIcon::fallbackThemeName() even for themes with explicit parents 2023-06-18 10:49:14 +02:00
plugin QIcon: enable icon engine plugins to implement themes 2024-05-30 02:36:04 +02:00
second_icons/testtheme/32x32/actions
styles/commonstyle/images
.gitignore
CMakeLists.txt QIcon: enable icon engine plugins to implement themes 2024-05-30 02:36:04 +02:00
image.png
rect.png
tst_qicon.cpp QIcon: enable icon engine plugins to implement themes 2024-05-30 02:36:04 +02:00