From 692a490b16f51af73f7968b993e6a659d07229ce Mon Sep 17 00:00:00 2001 From: Venu Date: Mon, 1 Sep 2014 13:11:14 +0200 Subject: Doc: Removed an unnecessary step from the porting instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using the absolute URL to the resource stored in a qrc avoids the need for the removed step. i.e. The "qrc:" scheme-based URLs to load a resource from the qrc file must include the PREFIX defined while creating the qrc file. Without the PREFIX, the relative references in the QML document will not be resolved, unless they are expcitly imported with a qualified local namespace. Task-number: QTBUG-40300 Change-Id: I3f9d02c4c1110c4b8c63b45ad8e54f27007c0218 Reviewed-by: Topi Reiniƶ Reviewed-by: Eskil Abrahamsen Blomfeldt --- doc/src/platforms/android.qdoc | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'doc/src/platforms/android.qdoc') diff --git a/doc/src/platforms/android.qdoc b/doc/src/platforms/android.qdoc index a080a1a7..0b990082 100644 --- a/doc/src/platforms/android.qdoc +++ b/doc/src/platforms/android.qdoc @@ -237,24 +237,18 @@ application to Android using the qrc approach: \li Open the existing project in Qt Creator and configure it with "Android for ARM" kit. For more information, see \l{Qt Creator: Configuring Projects} - \li Update all local directory imports in the \c{qml} files to use a local - namespace. For example, to import the QML documents in the "contents" - directory relative to \c{main.qml}, use the following import statement: - - \code - import "contents" as Contents - \endcode \li Identify all the resources used by your application and add them to one or more qrc files. Qt Creator updates your qmake project file with the "RESOURCES" variable listing the qrc files you added. - \li To load or refer to the resources in the qrc file from a C++ file, - use the "qrc:" prefix with the URL. For example, to load - the \c{main.qml} file from \c{resources.qrc}, you can use the following - code in your \c{main} function: + \li To load or refer to the resources in the qrc file from your C++ code, + use the "qrc:" scheme followed by the absolute URL. For example, to + load the \c{main.qml} file from \c{resources.qrc}, you can use the + following C++ code: + \code QQuickView viewer; - viewer.setSource(QUrl("qrc:qml/main.qml")); + viewer.setSource(QUrl("qrc:/qml/main.qml")); viewer.show(); \endcode -- cgit v1.2.1