Set as icons the theme's defaults?
-
wrote on 6 Jun 2011, 12:53 last edited by
Hello, I am using ubuntu linux and I am developing an application and I want to free some space from it, so I chose to replace some icons (the play/start/pause ones) with the system's default. The icons are located in /usr/share/icons but their location changes every time the user changes its theme. That means that i cannot have a path and be sure that the system's icon will be there.
For example, if a user has the 'default' theme, then the 'play' icon will have as path:
/usr/share/icons/default/play.png
But if the user change theme, for example switch to 'oxygen' theme, the 'play' icon will be located at
/usr/share/icons/oxygen/play.pngIs there any function from Qt that calls the default icons?
For example
QIcon::Play or QIcon::Pause ?Applications like Clementine (Qt based) and totem that have their icons depending on the system's theme, so such a function should exist
Thanks for any reply...
-
wrote on 6 Jun 2011, 14:38 last edited by
Yes you can use QIcon::fromTheme() for this.
-
wrote on 6 Jun 2011, 14:39 last edited by
Note that if you deploy your application on windows or mac fromTheme will return an empty icon by default so might have to provide fallbacks on those platforms. (though usually windows and mac users don't use icons for menu entries or buttons anyways)
-
wrote on 6 Jun 2011, 16:19 last edited by
thanks.
Is there any list in which I can use so as to see which are my options?
For example I want the play button ( > ) the pause ( || ) etc, but they don't seem to exist....How do I know which are my options?
Thanks again -
wrote on 6 Jun 2011, 16:21 last edited by
-
wrote on 6 Jun 2011, 16:49 last edited by
Thanks for that! I need it also for my app ;)
4/6