qt5base-lts/tests/auto/gui/image/qicon/icons
Tor Arne Vestbø f4dca7c512 Consult QIcon::fallbackThemeName() even for themes with explicit parents
We would previously only use the fallback theme for themes that did
not exist, or for themes that did not declare any parent theme.

We now unconditionally use the fallback theme, even for themes that
declare their own parent themes, so that a QIcon::fromTheme("foo")
that doesn't exist in the current theme, nor any of its parents,
nor in "hicolor", will still be looked up in the fallback theme.

The reason this seemed to work in the existing tests was because
our test themes inherit system themes such as crystalsvg and gnome,
and we didn't provide a hicolor theme. Any of these themes missing
would lead us into the code path where we use the fallback theme
for a missing theme, masking that fact that we had not added the
fallback theme to the list of fallbacks for the theme that had
explicit parents declared.

The logic has been moved out of the theme parsing and into an
accessor in QIconTheme, so that we're not caching the fallback
theme lookup.

[ChangeLog][QtGui][QIcon] QIcon::fallbackThemeName() will now be
used as fallback even for themes that declare a parent theme.

Pick-to: 6.5 6.6
Change-Id: Ib0ce1dfe97030f23893460ed624073a719a3ebd1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-06-18 10:49:14 +02:00
..
fallbacktheme Invalidate QIconLoader cache when setting fallback theme 2023-06-18 00:05:18 +02:00
hicolor Consult QIcon::fallbackThemeName() even for themes with explicit parents 2023-06-18 10:49:14 +02:00
testtheme Consult QIcon::fallbackThemeName() even for themes with explicit parents 2023-06-18 10:49:14 +02:00
themeparent Consult QIcon::fallbackThemeName() even for themes with explicit parents 2023-06-18 10:49:14 +02:00