Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Using standard icons of OS for Qt application

[SOLVED] Using standard icons of OS for Qt application

Scheduled Pinned Locked Moved General and Desktop
5 Posts 4 Posters 9.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    soroush
    wrote on last edited by
    #1

    Hi,

    I would like to use some common icons for my app. like undo, redo, save and so on. In KDE all applications use same icons. I found that all icons, and generally all graphic resources are in in /usr/share (/usr/share/icons/oxygen/). I would like to use them in my app and when user changes theme of workspace or icons of workspace, my application theme changes too. Perhaps something cross-platform like QSettings that do job... does Qt provide something for this?

    1 Reply Last reply
    0
    • H Offline
      H Offline
      HuXiKa
      wrote on last edited by
      #2

      "QIcon::fromTheme":http://doc.qt.nokia.com/latest/qicon.html#fromTheme

      If you can find faults of spelling in the text above, you can keep them.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        soroush
        wrote on last edited by
        #3

        thnx :-)

        1 Reply Last reply
        0
        • S Offline
          S Offline
          steno
          wrote on last edited by
          #4

          You could also look at QStyle, which has a funciton called standardIcon which takes a enumerated type of the specific icon the current style uses.

          1 Reply Last reply
          0
          • B Offline
            B Offline
            bootchk
            wrote on last edited by
            #5

            You mentioned cross platform. fromTheme() apparently is not cross platform (not across Linux:OSX:Win, but maybe across KDE:Gnome.)

            bq. Note: By default, only X11 will support themed icons. In order to use themed icons on Mac and Windows, you will have to bundle a compliant theme in one of your themeSearchPaths() and set the appropriate themeName().

            I think 'bundle' means your distributed package would embed for example the Oxygen icon theme, since it would not be on the stock, non-Linux platforms.

            But QStyle.standardIcon() is cross platform in some sense: the icon would exist. Would the icon have platform look and feel? I think so. Would the icon follow the style of any theme chosen by a user? I'm not sure the platforms theme such icons, where 'standard' means ubiquitous across applications on a platform.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved