diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-24 01:08:10 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-24 01:08:10 (GMT) |
commit | 66ba1f88eeda3c26431faad2a0b550ce72f61b6a (patch) | |
tree | 332329c2b0ebd19bf8c0b839f7e9120bcc8781fe /src | |
parent | 9ea81cbc63db063cd30797fd265a9002430ebd2f (diff) | |
parent | fae6f6401f25a743516e726dede6534dc4c6b0e0 (diff) | |
download | Qt-66ba1f88eeda3c26431faad2a0b550ce72f61b6a.zip Qt-66ba1f88eeda3c26431faad2a0b550ce72f61b6a.tar.gz Qt-66ba1f88eeda3c26431faad2a0b550ce72f61b6a.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml:
Link to example files from tutorial pages
Add tutorial for writing QML extensions
no export in plugin
Add doc pages for qml examples.
Replace usage of print() with console.log().
Remove out-of-date performance doc.
Fix hidden menu on embedded.
Location of binary is not on installed-content import path.
Doc fixes.
Return null if creation fails.
Basic Component doc.
Collection of small doc improvements
compile
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/qdeclarativecomponent.cpp | 81 | ||||
-rw-r--r-- | src/imports/gestures/plugin.cpp | 3 | ||||
-rw-r--r-- | src/imports/gestures/qdeclarativegesturearea_p.h | 2 |
3 files changed, 80 insertions, 6 deletions
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index 3899e73..161ce56 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,13 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q } /*! + \qmlmethod object Component::createObject() + Returns an object instance from this component, or null if object creation fails. + + The object will be created in the same context as the component was created in. +*/ + +/*! \internal A version of create which returns a scriptObject, for use in script */ @@ -533,10 +608,10 @@ QScriptValue QDeclarativeComponent::createObject() Q_D(QDeclarativeComponent); QDeclarativeContext* ctxt = creationContext(); if(!ctxt) - return QScriptValue(); + return QScriptValue(QScriptValue::NullValue); QObject* ret = create(ctxt); if (!ret) - return QScriptValue(); + return QScriptValue(QScriptValue::NullValue); QDeclarativeEnginePrivate *priv = QDeclarativeEnginePrivate::get(d->engine); QDeclarativeData::get(ret, true)->setImplicitDestructible(); return priv->objectClass->newQObject(ret, QMetaType::QObjectStar); diff --git a/src/imports/gestures/plugin.cpp b/src/imports/gestures/plugin.cpp index 9f5d923..b8a9751 100644 --- a/src/imports/gestures/plugin.cpp +++ b/src/imports/gestures/plugin.cpp @@ -53,8 +53,7 @@ public: virtual void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.gestures")); - qmlRegisterCustomType<QDeclarativeGestureArea>(uri,1,0, "GestureArea", "QDeclarativeGestureArea", - new QDeclarativeGestureAreaParser); + qmlRegisterCustomType<QDeclarativeGestureArea>(uri,1,0, "GestureArea", new QDeclarativeGestureAreaParser); } }; diff --git a/src/imports/gestures/qdeclarativegesturearea_p.h b/src/imports/gestures/qdeclarativegesturearea_p.h index 8e2c066..0195511 100644 --- a/src/imports/gestures/qdeclarativegesturearea_p.h +++ b/src/imports/gestures/qdeclarativegesturearea_p.h @@ -59,7 +59,7 @@ QT_MODULE(Declarative) class QDeclarativeBoundSignal; class QDeclarativeContext; class QDeclarativeGestureAreaPrivate; -class Q_DECLARATIVE_EXPORT QDeclarativeGestureArea : public QDeclarativeItem +class QDeclarativeGestureArea : public QDeclarativeItem { Q_OBJECT |