Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Android system images in QML

Android system images in QML

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 961 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.
  • C Offline
    C Offline
    charango
    wrote on last edited by
    #1

    Is there any way to use system Android resources (images) in QML code?
    Like images I see in %ANDROID_SDK_DIR%\platforms\android-xx\data\res\drawable-yyyy?

    @import QtQuick 2.3
    import QtQuick.Controls 1.2

    ApplicationWindow {
    title: qsTr("Hello World")
    width: Screen.width
    height: Screen.height
    visible: true

    Image {
    source: "file://android/image/drawable/ic_menu_more" // don't work
    }
    }
    @

    1 Reply Last reply
    0
    • GianlucaG Offline
      GianlucaG Offline
      Gianluca
      wrote on last edited by
      #2

      It seems that not all drawable can be used by Android native app.
      From this discussion: http://stackoverflow.com/questions/4673629/how-can-i-access-all-drawables-in-android
      the best approach is to copy the image into your app bundle (even in the case of Android native app).
      So, copy it as a Qt resource and reference it as: "qrc://... "

      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