Bug 511777 - `QIcon::setFallbackThemeName()` not working like expected in the runtime
Summary: `QIcon::setFallbackThemeName()` not working like expected in the runtime
Status: REPORTED
Alias: None
Product: Qt/KDE Flatpak Runtime
Classification: Developer tools
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-07 16:01 UTC by Rosalie
Modified: 2025-11-07 16:01 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rosalie 2025-11-07 16:01:00 UTC
SUMMARY

I have the following code in my application:
```
QString fallbackThemeName = QIcon::themeName();
QIcon::setThemeName("white");
QIcon::setFallbackThemeName(fallbackThemeName);
```

the application has a white icon theme embedded in its executable using the Qt resource system for some custom icons.

actual code can be found here:
https://github.com/Rosalie241/RMG/blob/v0.8.7/Source/RMG/UserInterface/MainWindow.cpp#L338-L441

when setting the icon theme with QIcon::setThemeName() and then set a fallback using QIcon::setFallbackThemeName(), it appears that the fallback theme name is not respected in the runtime.

I always get black fallback icons while I'm using dark breeze for icons that the embedded icon theme doesn't provide, even though the fallbackThemeName variable is set to 'breeze-dark', hardcoding it to anything else has no effect either.

STEPS TO REPRODUCE
1. set system KDE theme to breeze dark
2. download/build https://github.com/flathub/com.github.Rosalie241.RMG
3. open the settings dialog (settings -> settings) and see the defaults/ok/cancel buttons having incorrect icons

when building the application natively outside the flatpak, it works like expected and shows the correct fallback icons.

EXPECTED RESULT

I'd expect the icons to show the correct fallback icons.



I'm using Fedora KDE 43 with a fully up-to-date system.

I'm not sure where the issue lies, but considering it only happens within the flatpak runtime and not the AppImage or natively built packages, my guess is that it might be runtime related.