summaryrefslogtreecommitdiffstats
path: root/doc/src/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-02-17 07:19:56 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-02-17 07:19:56 (GMT)
commit2b3ffec298b1c210d0e978c6c0e9cc4f51e72294 (patch)
tree4a84e031115a5bc5f4a0b60099cdb433780f0a5b /doc/src/declarative
parent7f6317c25e6c1ec457971ab70c850d4d2bbe4cd2 (diff)
downloadQt-2b3ffec298b1c210d0e978c6c0e9cc4f51e72294.zip
Qt-2b3ffec298b1c210d0e978c6c0e9cc4f51e72294.tar.gz
Qt-2b3ffec298b1c210d0e978c6c0e9cc4f51e72294.tar.bz2
Document loading QML from Qt resources.
Diffstat (limited to 'doc/src/declarative')
-rw-r--r--doc/src/declarative/qtbinding.qdoc36
1 files changed, 36 insertions, 0 deletions
diff --git a/doc/src/declarative/qtbinding.qdoc b/doc/src/declarative/qtbinding.qdoc
index cae0263..2b427dc 100644
--- a/doc/src/declarative/qtbinding.qdoc
+++ b/doc/src/declarative/qtbinding.qdoc
@@ -358,5 +358,41 @@ void MyApplication::continueLoading()
}
}
\endcode
+
+\section1 Qt Resources
+
+QML content can be loaded from \l {The Qt Resource System} using the \e qrc: URL scheme.
+For example:
+
+\code
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+ <file>main.qml</file>
+ <file>images/background.png</file>
+</qresource>
+</RCC>
+\endcode
+\code
+// main.cpp
+MyApplication::MyApplication()
+{
+ // ...
+ component = new QmlComponent(engine, QUrl("qrc:/main.qml"));
+ if (component->isError()) {
+ qWarning() << component->errors();
+ } else {
+ QObject *myObject = component->create();
+ }
+}
+\endcode
+\code
+// main.qml
+import Qt 4.6
+
+Image {
+ source: "images/background.png"
+}
+\endcode
+
*/