diff options
author | Venu <venugopal.shivashankar@digia.com> | 2014-09-01 13:11:14 +0200 |
---|---|---|
committer | Venugopal Shivashankar <venugopal.shivashankar@digia.com> | 2014-09-02 14:58:13 +0200 |
commit | 692a490b16f51af73f7968b993e6a659d07229ce (patch) | |
tree | 6457c207df582d98768abbedb8f3382fa5b6ac75 | |
parent | 5e677e11eccc47742d354b2032f6f3c3ad142382 (diff) |
Doc: Removed an unnecessary step from the porting instructions
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ƶ <topi.reinio@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
-rw-r--r-- | doc/src/platforms/android.qdoc | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/doc/src/platforms/android.qdoc b/doc/src/platforms/android.qdoc index a080a1a7e..0b990082f 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 |