Android system images in QML
-
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.2ApplicationWindow {
title: qsTr("Hello World")
width: Screen.width
height: Screen.height
visible: trueImage {
source: "file://android/image/drawable/ic_menu_more" // don't work
}
}
@ -
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://... "