summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-06-09 08:04:48 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-06-09 23:36:32 (GMT)
commit4a36a17e06b3ec7c20bcef9692d46dba5504151a (patch)
tree736843e2bab5e7a5a553a70234ab3d29ff5753fa /src/declarative/qml
parentce8a3100868e2c545d0af3332e9b801c1fd0bc3f (diff)
downloadQt-4a36a17e06b3ec7c20bcef9692d46dba5504151a.zip
Qt-4a36a17e06b3ec7c20bcef9692d46dba5504151a.tar.gz
Qt-4a36a17e06b3ec7c20bcef9692d46dba5504151a.tar.bz2
Doc improvements: move some example code to snippets, add screenshots,
other minor doc fixes
Diffstat (limited to 'src/declarative/qml')
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp12
-rw-r--r--src/declarative/qml/qdeclarativecontext.cpp2
2 files changed, 8 insertions, 6 deletions
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index 7b51239..55ee783 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -547,16 +547,18 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q
/*!
\qmlmethod object Component::createObject(parent)
- Returns an object instance from this component, or null if object creation fails.
+
+ Creates and returns an object instance of this component that will have the given
+ \a parent. Returns null if object creation fails.
The object will be created in the same context as the one in which the component
was created. This function will always return null when called on components
which were not created in QML.
- Note that if the returned object is to be displayed, its \c parent must be set to
- an existing item in a scene, or else the object will not be visible. The parent
- argument is required to help you avoid this, you must explicitly pass in null if
- you wish to create an object without setting a parent.
+ If you wish to create an object without setting a parent, specify \c null for
+ the \a parent value. Note that if the returned object is to be displayed, you
+ must provide a valid \a parent value or set the returned object's \l{Item::parent}{parent}
+ property, or else the object will not be visible.
*/
/*!
diff --git a/src/declarative/qml/qdeclarativecontext.cpp b/src/declarative/qml/qdeclarativecontext.cpp
index 6a13f15..2221d78 100644
--- a/src/declarative/qml/qdeclarativecontext.cpp
+++ b/src/declarative/qml/qdeclarativecontext.cpp
@@ -116,7 +116,7 @@ QDeclarativeContextPrivate::QDeclarativeContextPrivate()
All properties added explicitly by QDeclarativeContext::setContextProperty() take
precedence over the context object's properties.
- Contexts form a hierarchy. The root of this heirarchy is the QDeclarativeEngine's
+ Contexts form a hierarchy. The root of this hierarchy is the QDeclarativeEngine's
\l {QDeclarativeEngine::rootContext()}{root context}. A component instance can
access the data in its own context, as well as all its ancestor contexts. Data
can be made available to all instances by modifying the