Bug 511777

Summary: `QIcon::setFallbackThemeName()` not working like expected in the runtime
Product: [Developer tools] Qt/KDE Flatpak Runtime Reporter: Rosalie <rosalie>
Component: generalAssignee: Aleix Pol <aleixpol>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

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.