Use of Qt standard icons from within Qt Creator

后端 未结 3 1982
甜味超标
甜味超标 2021-02-05 07:38

I would like to use the Qt Standard icons (as here). I have found many examples how to set the icons programmatically (runtime in code).

However, how could I se

3条回答
  •  我在风中等你
    2021-02-05 08:06

    Theme icons are only supported on Linux/X11. On Windows and OS X, you have to provide your own icons.

    The solution to this problem is to set the theme name in QtCreator (as in your example). Then you have to provide icons of the same Alias under Prefix ":/icons" in your resources. You can leverage icons from sets available in the public domain, e.g. the popular Tango icon set.

    If you only target the Windows platform, the theme setting will be of no use for you. If you target both Linux/X11 and other platforms, with this solution you get the native icons on one system and the icons you provide yourself on the others.

    You can find a very good explanation on how to do it here: http://mithatkonar.com/wiki/doku.php/qt/icons

提交回复
热议问题