Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Native icons in QML on MeeGo Harmattan

Native icons in QML on MeeGo Harmattan

Scheduled Pinned Locked Moved Mobile and Embedded
6 Posts 3 Posters 5.8k 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.
  • K Offline
    K Offline
    kkrzewniak
    wrote on last edited by
    #1

    Hi does anyone know if it's possible to access the icons for the current theme and use them in QML?

    Me, Grimlock, not "nice dino". ME BASH BRAINS!

    1 Reply Last reply
    0
    • U Offline
      U Offline
      ucomesdag
      wrote on last edited by
      #2

      Yes, it's possible most icons are living in /usr/share/theme/blanco/meegotouch/icons ;-)

      Write “Qt”, not “QT” (QuickTime).

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kkrzewniak
        wrote on last edited by
        #3

        Thanks I knew this actually but was wondering if there was nicer way of doing that than:
        @
        class PlatformIconProvider : public QDeclarativeImageProvider
        {
        ...
        };

        QImage PlatformIconProvider::requestImage(const QString &id, QSize *size, const QSize &requestedSize)
        {
        QImage result;
        if(result.load(QLatin1String("/usr/share/themes/blanco/meegotouch/icons/") + id + QLatin1String(".png"))) {
        qDebug() << "Loaded: " << id;
        }
        return result;
        }@

        Me, Grimlock, not "nice dino". ME BASH BRAINS!

        1 Reply Last reply
        0
        • U Offline
          U Offline
          ucomesdag
          wrote on last edited by
          #4

          See the example "gallery":https://qt.gitorious.org/qt-components/qt-components/blobs/master/examples/meego/QmlComponentGallery/qml/main.qml they use @background: "image://theme/meegotouch-wallpaper-portrait";@
          for /usr/share/themes/blanco/meegotouch/images/backgrounds/meegotouch-wallpaper-portrait.jpg

          So for example @image://theme/icon-m-common-search@ for /usr/share/themes/blanco/meegotouch/icons/icon-m-common-search.png.

          I confirm that this works for me.

          Write “Qt”, not “QT” (QuickTime).

          1 Reply Last reply
          0
          • T Offline
            T Offline
            Tory Gaurnier
            wrote on last edited by
            #5

            Is that something that's only built into meego, or would something like this work on a Linux desktop (and other OSes)?

            1 Reply Last reply
            0
            • T Offline
              T Offline
              Tory Gaurnier
              wrote on last edited by
              #6

              Well it looks like I answered my own question, -when you use "image://theme/my_image" on desktop linux (I'm on Ubuntu), it searches in "current_theme/qmltheme/my_image", so you can't expect to be using your GTK or KDE icons like that, only whatever icons are in the qmltheme folder.-

              Never mind, I was mistaken, doesn't work at all on Linux, if someone knows of something similar that will, please do tell. Using image://theme/my_image actually just throws the error "invalid image provider"

              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