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. How does flag-aa works with QIcon::fromTheme()?
Forum Updated to NodeBB v4.3 + New Features

How does flag-aa works with QIcon::fromTheme()?

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 3.3k Views 1 Watching
  • 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.
  • L Offline
    L Offline
    Leon
    wrote on last edited by
    #1

    ok so

    @ui->startButton->setIcon(QIcon::fromTheme("flag-en"));@

    doesn't work.. so what am i supposed to do?

    P.S Here is the "link":http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html#guidelines

    1 Reply Last reply
    0
    • F Offline
      F Offline
      Franzk
      wrote on last edited by
      #2

      I don't think "en" is the country specifier for the UK. You should probably try, uhm..., flag-uk (united kingdom) or flag-gb (great britain). However, England has a flag as well, I'm not sure if that's included there. Another possibility is that the icon theme just doesn't supply the flag.

      "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

      http://www.catb.org/~esr/faqs/smart-questions.html

      1 Reply Last reply
      0
      • L Offline
        L Offline
        Leon
        wrote on last edited by
        #3

        No i searched at the ISO 3166.. Whatever country i set there is no icon.. Yes probably it will not be included at the icons of the theme... Thanks anyway for the reply

        1 Reply Last reply
        0
        • J Offline
          J Offline
          Jens
          wrote on last edited by
          #4

          The freedesktop standard page is only a suggestion/guideline and there is no guarantee that any specific distro supports it completely. I don't think Ubuntu ships with themed flag icons. To see which icons are actually available for Ubuntu, you can search in the /usr/share/icons/Humanity (or gnome) folders. Anything you find in there should be available to fromTheme.

          However doing a quick disk search reveals that you might be able to load the icon manually at:
          "/usr/share/locale/l10n/XX/flag.png" where XX refers to country code. Just make sure your code doesn't crash if the file is not available. :)

          1 Reply Last reply
          0
          • L Offline
            L Offline
            Leon
            wrote on last edited by
            #5

            I don't have the folder l10n.. I just wanted to free some space from my app so better not to risk it for just 2 flags :P

            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