-
Notifications
You must be signed in to change notification settings - Fork 40
Icons from theme are not displayed in QtWidgets Application #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I built the AppImage in a debian stretch docker container via drone, this is the recipe: https://schlomp.space/tastytea/whyblocked/src/branch/master/.drone.yml |
I have the same problem with the QtWidgetsApplication in linuxdeploy/linuxdeploy-plugin-qt-examples. |
An AppImage should include all its dependencies. Not only shared libraries but also other resources such as icons. There is no warranty that the icons that you use will be in every Linux system, therefore, you must also embed them. Two options came to my mind to achieve it:
Still, we must find out why icons from theme are not being loaded properly. |
For more information of the "Option 1" see https://stackoverflow.com/questions/50918398/geting-icon-by-name-is-not-working |
After a lot of testing, I found that there are several plugins that affect this functionality. Those are:
Therefore if you want that your app to properly show the icons from the theme on every desktop environment you will have to include all of the above plugins. In the case of the Currently modifying the QtWidgetsApplication in order to demonstrate a proper way of doing it. |
Fix icons not being loaded contributes to linuxdeploy/linuxdeploy-plugin-qt#17
Sadly we cannot warranty that all the You can find an example of how to do it in this project QtWidgetsApplication In short, load your icons this way: |
If your application requires additional plugins you can always use the environment variable
|
I have a program which I package as a dpkg and as an AppImage, from the same source. The binary from the dpkg shows icons in the toolbar, the AppImage does not. I use icon names specified in the Icon Naming Specification, like
QIcon::fromTheme("list-add")
. I do not modify any environment variables for the AppImage.In Ubuntu 18.04 no icons are shown, in Gentoo there are icons but not from the system theme.
AppImage: https://schlomp.space/attachments/15cba25f-e5a0-4c14-b08b-df35f8a4672e
.ui-file where I specify the icons: https://schlomp.space/tastytea/whyblocked/src/branch/master/src/whyblocked.ui#L141
The generated code looks like this:
Edit: Icons are shown in Fedora 28, no icons in Elementary 5.
The text was updated successfully, but these errors were encountered: