summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-05-06 04:39:01 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-05-06 04:39:01 (GMT)
commit8f23ea2dc59afaf74a7699aa9334dc7ec61e9d4f (patch)
tree014c8780414c46c290c6a8f3af10c9adffd1d812 /src/declarative
parentbcfb24b17cf5c97c734c82ca2072eb8b13b80eec (diff)
downloadQt-8f23ea2dc59afaf74a7699aa9334dc7ec61e9d4f.zip
Qt-8f23ea2dc59afaf74a7699aa9334dc7ec61e9d4f.tar.gz
Qt-8f23ea2dc59afaf74a7699aa9334dc7ec61e9d4f.tar.bz2
doc
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/qml/qmlcontext.cpp4
-rw-r--r--src/declarative/qml/qmlengine.cpp29
-rw-r--r--src/declarative/util/qmltransition.cpp2
3 files changed, 12 insertions, 23 deletions
diff --git a/src/declarative/qml/qmlcontext.cpp b/src/declarative/qml/qmlcontext.cpp
index 68453c3..cf33610 100644
--- a/src/declarative/qml/qmlcontext.cpp
+++ b/src/declarative/qml/qmlcontext.cpp
@@ -136,7 +136,7 @@ void QmlContextPrivate::addDefaultObject(QObject *object, Priority priority)
QmlContext context(engine.rootContext());
context.setContextProperty("myModel", modelData);
- QmlComponent component("<ListView model=\"{myModel}\" />");
+ QmlComponent component("ListView { model=myModel }");
component.create(&context);
\endcode
@@ -163,7 +163,7 @@ void QmlContextPrivate::addDefaultObject(QObject *object, Priority priority)
QmlContext context(engine.rootContext());
context.addDefaultObject(&myDataSet);
- QmlComponent component("<ListView model=\"{myModel}\" />");
+ QmlComponent component("ListView { model=myModel }");
component.create(&context);
\endcode
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp
index 4d6b64f..7dcab6f 100644
--- a/src/declarative/qml/qmlengine.cpp
+++ b/src/declarative/qml/qmlengine.cpp
@@ -501,33 +501,22 @@ void QmlEngine::addNameSpacePath(const QString& ns, const QString& path)
/*!
Returns the mapping from namespace URIs to URLs.
- Namespaces in QML allow types to be specified by a URI,
- using standard XML namespaces:
+ Currently, only the empty namespace is supported
+ (i.e. types cannot be qualified with a namespace).
- \code
- <Item xmlns:foo="xyz://abc/def">
- <foo:Bar/>
- </Item>
- \endcode
-
- Actual QML types can be defined in URLs, in which case a mapping
- may be made from URIs (such as "xyz://abc/def/Bar.qml" above, to
- URLs (such as "file:///opt/abcdef/Bar.qml"):
+ The QML \c import statement can be used to import a directory of
+ components into the empty namespace.
- \code
- engine->addNameSpacePath("xyz://abc/def","file:///opt/abcdef");
- \endcode
+ \qml
+ import "MyModuleDirectory"
+ \endqml
- If only a prefix of the URI is mapped, the path of the URI is
- mapped similarly to the URL:
+ This is also possible from C++:
\code
- engine->addNameSpacePath("xyz://abc","file:///opt/jkl");
+ engine->addNameSpacePath("","file:///opt/abcdef");
\endcode
- In the above case, "xyz://abc/def/Bar.qml" would then map to
- "file:///opt/jkl/def/Bar.qml".
-
\sa componentUrl()
*/
QMap<QString,QString> QmlEngine::nameSpacePaths() const
diff --git a/src/declarative/util/qmltransition.cpp b/src/declarative/util/qmltransition.cpp
index 47e70ad..26ed8b1 100644
--- a/src/declarative/util/qmltransition.cpp
+++ b/src/declarative/util/qmltransition.cpp
@@ -265,7 +265,7 @@ void QmlTransition::setToState(const QString &t)
This property holds a list of the animations to be run for this transition.
The top-level animations in operations are run in parallel.
- To run them sequentially, you can create a single <SequentialAnimation>
+ To run them sequentially, you can create a single SequentialAnimation
which contains all the animations, and assign that to operations.
\default
*/