summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-04-23 01:32:11 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-04-23 04:54:13 (GMT)
commit9a11e0288869cdf53350a95bedf28374c8fccb31 (patch)
tree9fc8f715e55117a8cdb71cdbe347ab19be46baaf /src
parentc8359ce7b9ec72c100d8b46f8ac86ec6e8fbed02 (diff)
downloadQt-9a11e0288869cdf53350a95bedf28374c8fccb31.zip
Qt-9a11e0288869cdf53350a95bedf28374c8fccb31.tar.gz
Qt-9a11e0288869cdf53350a95bedf28374c8fccb31.tar.bz2
Basic Component doc.
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp75
1 files changed, 74 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index 3899e73..24edf7d 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -152,7 +152,7 @@ int statusId = qRegisterMetaType<QDeclarativeComponent::Status>("QDeclarativeCom
\value Null This QDeclarativeComponent has no data. Call loadUrl() or setData() to add QML content.
\value Ready This QDeclarativeComponent is ready and create() may be called.
\value Loading This QDeclarativeComponent is loading network data.
- \value Error An error has occured. Calling errorDescription() to retrieve a description.
+ \value Error An error has occured. Call errors() to retrieve a list of \{QDeclarativeError}{errors}.
*/
void QDeclarativeComponentPrivate::typeDataReady()
@@ -237,6 +237,18 @@ QDeclarativeComponent::~QDeclarativeComponent()
}
/*!
+ \qmlproperty enumeration Component::status
+ This property holds the status of component loading. It can be one of:
+ \list
+ \o Null - no data is available for the component
+ \o Ready - the component has been loaded, and can be used to create instances.
+ \o Loading - the component is currently being loaded
+ \o Error - an error occurred while loading the component.
+ Calling errorsString() will provide a human-readable description of any errors.
+ \endlist
+ */
+
+/*!
\property QDeclarativeComponent::status
The component's current \l{QDeclarativeComponent::Status} {status}.
*/
@@ -255,6 +267,14 @@ QDeclarativeComponent::Status QDeclarativeComponent::status() const
}
/*!
+ \qmlproperty bool Component::isNull
+
+ Is true if the component is in the Null state, false otherwise.
+
+ Equivalent to status == Component.Null.
+*/
+
+/*!
\property QDeclarativeComponent::isNull
Is true if the component is in the Null state, false otherwise.
@@ -267,6 +287,14 @@ bool QDeclarativeComponent::isNull() const
}
/*!
+ \qmlproperty bool Component::isReady
+
+ Is true if the component is in the Ready state, false otherwise.
+
+ Equivalent to status == Component.Ready.
+*/
+
+/*!
\property QDeclarativeComponent::isReady
Is true if the component is in the Ready state, false otherwise.
@@ -279,6 +307,16 @@ bool QDeclarativeComponent::isReady() const
}
/*!
+ \qmlproperty bool Component::isError
+
+ Is true if the component is in the Error state, false otherwise.
+
+ Equivalent to status == Component.Error.
+
+ Calling errorsString() will provide a human-readable description of any errors.
+*/
+
+/*!
\property QDeclarativeComponent::isError
Is true if the component is in the Error state, false otherwise.
@@ -291,6 +329,14 @@ bool QDeclarativeComponent::isError() const
}
/*!
+ \qmlproperty bool Component::isLoading
+
+ Is true if the component is in the Loading state, false otherwise.
+
+ Equivalent to status == Component::Loading.
+*/
+
+/*!
\property QDeclarativeComponent::isLoading
Is true if the component is in the Loading state, false otherwise.
@@ -303,6 +349,12 @@ bool QDeclarativeComponent::isLoading() const
}
/*!
+ \qmlproperty real Component::progress
+ The progress of loading the component, from 0.0 (nothing loaded)
+ to 1.0 (finished).
+*/
+
+/*!
\property QDeclarativeComponent::progress
The progress of loading the component, from 0.0 (nothing loaded)
to 1.0 (finished).
@@ -488,6 +540,17 @@ QList<QDeclarativeError> QDeclarativeComponent::errors() const
}
/*!
+ \qmlmethod string Component::errorsString()
+
+ Returns a human-readable description of any errors.
+
+ The string includes the file, location, and description of each error.
+ If multiple errors are present they are separated by a newline character.
+
+ If no errors are present, an empty string is returned.
+*/
+
+/*!
\internal
errorsString is only meant as a way to get the errors in script
*/
@@ -506,6 +569,11 @@ QString QDeclarativeComponent::errorsString() const
}
/*!
+ \qmlproperty url Component::url
+ The component URL. This is the URL that was used to construct the component.
+*/
+
+/*!
\property QDeclarativeComponent::url
The component URL. This is the URL passed to either the constructor,
or the loadUrl() or setData() methods.
@@ -525,6 +593,11 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q
}
/*!
+ \qmlmethod object Component::createObject()
+ Returns an object instance from this component.
+*/
+
+/*!
\internal
A version of create which returns a scriptObject, for use in script
*/