| Summary: | Icon themes from inside Qt5 application resources are ignored | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-frameworkintegration | Reporter: | Petr Mrázek <peterix> |
| Component: | general | Assignee: | kdelibs bugs <kdelibs-bugs-null> |
| Status: | RESOLVED UPSTREAM | ||
| Severity: | normal | CC: | cfeck, debian, faure, kaperang07, nlminhtl, rdieter, simonandric5 |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Arch Linux | ||
| OS: | Linux | ||
| URL: | http://i.imgur.com/PKww9sH.jpg | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
Bug demo
new bug_demo attachment-28603-0.html |
||
|
Description
Petr Mrázek
2015-02-22 23:54:16 UTC
Application issue: https://github.com/MultiMC/MultiMC5/issues/796 s/platfromintegration/frameworkintegration/g ... it's been a very long evening :) https://qt.gitorious.org/qt/qtbase/source/73a1e8c60d894701f34806cc4b847aa2814bf389:src/gui/image/qicon.cpp#L1174 and the 2 lines below make it always use the platform theme when it's available. Petr, could you test this patch for "kiconthemes" framework? If it works, I will discuss with frameworks developers if it can be integrated.
diff --git a/src/kiconloader.cpp b/src/kiconloader.cpp
index c47eecb..6015fc1 100644
--- a/src/kiconloader.cpp
+++ b/src/kiconloader.cpp
@@ -556,6 +556,8 @@ bool KIconLoaderPrivate::initIconThemes()
searchPaths.append("icons"); // was xdgdata-icon in KStandardDirs
// These are not in the icon spec, but e.g. GNOME puts some icons there anyway.
searchPaths.append("pixmaps"); // was xdgdata-pixmaps in KStandardDirs
+ // Fallback to Qt resources
+ searchPaths.append(":/icons");
#ifndef NDEBUG
QString dbgString = "Theme tree: ";
No. That just doesn't seem to change anything.
I also uncommented the debug code below and got this:
0.065 D "Theme tree: (Oxygen)"
I have a bunch of different themes, which do not match any of the system theme names, but the user can switch them inside the application:
[peterix ~/projects/minecraft/src/MultiMC5/application/resources]$ find . | grep index.theme
./pe_dark/index.theme
./iOS/index.theme
./pe_light/index.theme
./pe_blue/index.theme
./OSX/index.theme
./pe_colored/index.theme
./multimc/index.theme
[peterix ~/projects/minecraft/src/MultiMC5/application/resources]$ find . | grep qrc
./pe_dark/pe_dark.qrc
./iOS/iOS.qrc
./pe_light/pe_light.qrc
./pe_blue/pe_blue.qrc
./instances/instances.qrc
./backgrounds/backgrounds.qrc
./OSX/OSX.qrc
./pe_colored/pe_colored.qrc
./multimc/multimc.qrc
The themes exist in the resources in :/icons/$themeName/
Example qrc:
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource prefix="/icons/pe_colored">
<file>index.theme</file>
<file>scalable/about.svg</file>
<file>scalable/accounts.svg</file>
<file>scalable/bug.svg</file>
<file>scalable/centralmods.svg</file>
<file>scalable/checkupdate.svg</file>
<file>scalable/copy.svg</file>
<file>scalable/coremods.svg</file>
<file>scalable/externaltools.svg</file>
<file>scalable/instance-settings.svg</file>
<file>scalable/jarmods.svg</file>
<file>scalable/java.svg</file>
<file>scalable/loadermods.svg</file>
<file>scalable/log.svg</file>
<file>scalable/minecraft.svg</file>
<file>scalable/multimc.svg</file>
<file>scalable/new.svg</file>
<file>scalable/news.svg</file>
<file>scalable/notes.svg</file>
<file>scalable/patreon.svg</file>
<file>scalable/proxy.svg</file>
<file>scalable/quickmods.svg</file>
<file>scalable/refresh.svg</file>
<file>scalable/resourcepacks.svg</file>
<file>scalable/screenshots.svg</file>
<file>scalable/settings.svg</file>
<file>scalable/status-bad.svg</file>
<file>scalable/status-good.svg</file>
<file>scalable/status-yellow.svg</file>
<file>scalable/viewfolder.svg</file>
</qresource>
</RCC>
Example theme file:
[Icon Theme]
Name=pe_colored
Comment=Icons by pexner (colored)
Inherits=multimc
Directories=scalable
[scalable]
Size=48
Type=Scalable
MinSize=16
MaxSize=256
Everything inherits from the main (multimc) theme.
Possibly there is the same problem in this small demo https://github.com/F1ash/bug-demo It can be built for Qt4 and Qt5 via following commands: 1) for Qt4: mkdir build && cd build && cmake ../ -DBUILD_QT_VERSION=4 2) for Qt5: mkdir build && cd build && cmake ../ -DBUILD_QT_VERSION=5 And then an icon also doesn't appear in the Qt5 demo on the KDE5 (Fedora 22). Created attachment 92651 [details]
Bug demo
Adding a source archive here in the case if the author (not me :) ) of this bug demo will decide to remove the repository.
i'm created the new, more correctly test. It tested on openbox and within KF5/Plasma5. Bug is still. If iconTheme is uploaded, then Terminator is visible, else system "face-sad" icon is visible. Created attachment 93148 [details]
new bug_demo
I've submitted the following patch upstream https://codereview.qt-project.org/#/c/114415/ Hello again. I tried removing the QIcon fork from my application and using normal QIcon from Qt 5.5.0 (Arch linux packages). It's still a problem. Was this pushed to the actual 5.5(.0), or will this appear in some later Qt release? It was committed after 5.5.0 tag/release Created attachment 94047 [details] attachment-28603-0.html Alright. Good to know. I'll upgrade to a later 5.5 release :) On Sat, Aug 15, 2015 at 6:51 PM, Rex Dieter <rdieter@math.unl.edu> wrote: > https://bugs.kde.org/show_bug.cgi?id=344469 > > --- Comment #12 from Rex Dieter <rdieter@math.unl.edu> --- > It was committed after 5.5.0 tag/release > > -- > You are receiving this mail because: > You reported the bug. > So this is fixed in Qt, right ? (-> closing, please reopen if I misunderstood) |