[PySide] Get icons working on windows

Jonas Thiem jonasthiem at googlemail.com
Tue Apr 22 18:17:31 CEST 2014


Yea my call to QIcon.setThemeSearchPaths() was just utterly wrong.
(Argument should be list and not a string, and also it may be a good
idea to retain the old paths I guess)

With that fixed it works :-)

Sorry for bothering!

Regards,
Jonas Thiem


On Tue, Apr 22, 2014 at 4:30 PM, Jonas Thiem <jonasthiem at googlemail.com> wrote:
> Hi,
>
> I tried to get icons working on Windows. To do that, I did the following steps:
>
> 1.) I created an "icons" subfolder (where the current working
> directory of my application is when running)
> 2.) I built tango with ./configure && make on linux, and copied the
> resulting folder into "icons\Tango\" (with the index.theme inside
> etc.)
>
> Then I used the following code in my application startup:
>
>         if QIcon.themeName() == "":
>             QIcon.setThemeSearchPaths(os.path.abspath("icons"))
>             QIcon.setThemeName("Tango")
>             assert(QIcon.themeName() == "Tango")
>         assert(len(QIcon.themeName()) > 0)
>
> No assert fails, no error happens or anything. But all the stock icons
> from my PySide application are still missing. (They work perfectly
> fine on Linux/Gnome 3)
>
> Since there is no error or warning or anything, I don't know what to
> do from here. Any suggestions?
>
> Regards,
> Jonas Thiem



More information about the PySide mailing list