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. Set as icons the theme's defaults?

Set as icons the theme's defaults?

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 8.3k 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.
  • A Offline
    A Offline
    alexandros
    wrote on 6 Jun 2011, 12:53 last edited by
    #1

    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.png

    Is 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...

    1 Reply Last reply
    0
    • J Offline
      J Offline
      Jens
      wrote on 6 Jun 2011, 14:38 last edited by
      #2

      Yes you can use QIcon::fromTheme() for this.

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

      1 Reply Last reply
      0
      • J Offline
        J Offline
        Jens
        wrote on 6 Jun 2011, 14:39 last edited by
        #3

        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)

        1 Reply Last reply
        0
        • A Offline
          A Offline
          alexandros
          wrote on 6 Jun 2011, 16:19 last edited by
          #4

          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

          1 Reply Last reply
          0
          • A Offline
            A Offline
            alexandros
            wrote on 6 Jun 2011, 16:21 last edited by
            #5

            Ok, found it
            http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html#guidelines

            1 Reply Last reply
            0
            • L Offline
              L Offline
              Leon
              wrote on 6 Jun 2011, 16:49 last edited by
              #6

              Thanks for that! I need it also for my app ;)

              1 Reply Last reply
              0

              4/6

              6 Jun 2011, 16:19

              • Login

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