diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/qml/qdeclarativeproperty.cpp | 82 | ||||
-rw-r--r-- | src/declarative/util/qdeclarativeview.cpp | 19 |
2 files changed, 70 insertions, 31 deletions
diff --git a/src/declarative/qml/qdeclarativeproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp index 4f73b89..d223502 100644 --- a/src/declarative/qml/qdeclarativeproperty.cpp +++ b/src/declarative/qml/qdeclarativeproperty.cpp @@ -115,8 +115,10 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj) } /*! - Creates a QDeclarativeProperty for the default property of \a obj. If there is no - default property, an invalid QDeclarativeProperty will be created. + Creates a QDeclarativeProperty for the default property of \a obj + using the \l{QDeclarativeContext} {context} \a ctxt. If there is + no default property, an invalid QDeclarativeProperty will be + created. */ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, QDeclarativeContext *ctxt) : d(new QDeclarativePropertyPrivate) @@ -128,11 +130,13 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, QDeclarativeContext *ct } /*! - Creates a QDeclarativeProperty for the default property of \a obj. If there is no - default property, an invalid QDeclarativeProperty will be created. + Creates a QDeclarativeProperty for the default property of \a obj + using the environment for instantiating QML components that is + provided by \a engine. If there is no default property, an + invalid QDeclarativeProperty will be created. */ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, QDeclarativeEngine *engine) -: d(new QDeclarativePropertyPrivate) + : d(new QDeclarativePropertyPrivate) { d->q = this; d->context = 0; @@ -166,8 +170,9 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name) } /*! - Creates a QDeclarativeProperty for the property \a name of \a obj. - */ + Creates a QDeclarativeProperty for the property \a name of \a obj + using the \l{QDeclarativeContext} {context} \a ctxt. +*/ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QDeclarativeContext *ctxt) : d(new QDeclarativePropertyPrivate) { @@ -179,7 +184,9 @@ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QD } /*! - Creates a QDeclarativeProperty for the property \a name of \a obj. + Creates a QDeclarativeProperty for the property \a name of \a obj + using the environment for instantiating QML components that is + provided by \a engine. */ QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QDeclarativeEngine *engine) : d(new QDeclarativePropertyPrivate) @@ -766,11 +773,13 @@ QVariant QDeclarativeProperty::read(QObject *object, const QString &name) } /*! -Return the \a name property value of \a object. This method is equivalent to: -\code + Return the \a name property value of \a object. This method is + equivalent to: + + \code QDeclarativeProperty p(object, name, context); p.read(); -\endcode + \endcode */ QVariant QDeclarativeProperty::read(QObject *object, const QString &name, QDeclarativeContext *ctxt) { @@ -779,11 +788,15 @@ QVariant QDeclarativeProperty::read(QObject *object, const QString &name, QDecla } /*! -Return the \a name property value of \a object. This method is equivalent to: -\code + + Return the \a name property value of \a object using the environment + for instantiating QML components that is provided by \a engine. . + This method is equivalent to: + + \code QDeclarativeProperty p(object, name, engine); p.read(); -\endcode + \endcode */ QVariant QDeclarativeProperty::read(QObject *object, const QString &name, QDeclarativeEngine *engine) { @@ -1073,19 +1086,23 @@ const QMetaObject *QDeclarativePropertyPrivate::rawMetaObjectForType(QDeclarativ } /*! - Set the property value to \a value. -*/ + Sets the property value to \a value and returns true. + Returns false if the property can't be set because the + \a value is the wrong type, for example. + */ bool QDeclarativeProperty::write(const QVariant &value) const { return QDeclarativePropertyPrivate::write(*this, value, 0); } /*! -Writes \a value to the \a name property of \a object. This method is equivalent to: -\code + Writes \a value to the \a name property of \a object. This method + is equivalent to: + + \code QDeclarativeProperty p(object, name); p.write(value); -\endcode + \endcode */ bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVariant &value) { @@ -1094,13 +1111,18 @@ bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVa } /*! -Writes \a value to the \a name property of \a object. This method is equivalent to: -\code + Writes \a value to the \a name property of \a object using the + \l{QDeclarativeContext} {context} \a ctxt. This method is + equivalent to: + + \code QDeclarativeProperty p(object, name, ctxt); p.write(value); -\endcode + \endcode */ -bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVariant &value, +bool QDeclarativeProperty::write(QObject *object, + const QString &name, + const QVariant &value, QDeclarativeContext *ctxt) { QDeclarativeProperty p(object, name, ctxt); @@ -1108,11 +1130,15 @@ bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVa } /*! -Writes \a value to the \a name property of \a object. This method is equivalent to: -\code + + Writes \a value to the \a name property of \a object using the + environment for instantiating QML components that is provided by + \a engine. This method is equivalent to: + + \code QDeclarativeProperty p(object, name, engine); p.write(value); -\endcode + \endcode */ bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVariant &value, QDeclarativeEngine *engine) @@ -1122,7 +1148,9 @@ bool QDeclarativeProperty::write(QObject *object, const QString &name, const QVa } /*! - Resets the property value. + Resets the property and returns true if the property is + resettable. If the property is not resettable, nothing happens + and false is returned. */ bool QDeclarativeProperty::reset() const { diff --git a/src/declarative/util/qdeclarativeview.cpp b/src/declarative/util/qdeclarativeview.cpp index cd67aeb..735a009 100644 --- a/src/declarative/util/qdeclarativeview.cpp +++ b/src/declarative/util/qdeclarativeview.cpp @@ -221,7 +221,7 @@ void QDeclarativeViewPrivate::execute() */ /*! \fn void QDeclarativeView::statusChanged(QDeclarativeView::Status status) - This signal is emitted when the component's current \l{QDeclarativeView::Status} {status} changes. + This signal is emitted when the component's current \a status changes. */ /*! @@ -283,6 +283,12 @@ QDeclarativeView::~QDeclarativeView() delete d->root; } +/*! \property QDeclarativeView::source + \brief The URL of the source of the QML component. + + Changing this property causes the QML component to be reloaded. + */ + /*! Sets the source to the \a url, loads the QML component and instantiates it. @@ -326,7 +332,6 @@ QDeclarativeContext* QDeclarativeView::rootContext() return d->engine.rootContext(); } - /*! \enum QDeclarativeView::Status @@ -338,6 +343,14 @@ QDeclarativeContext* QDeclarativeView::rootContext() \value Error An error has occured. Calling errorDescription() to retrieve a description. */ +/*! \enum QDeclarativeView::ResizeMode + + This enum specifies how to resize the view. + + \value SizeViewToRootObject + \value SizeRootObjectToView +*/ + /*! \property QDeclarativeView::status The component's current \l{QDeclarativeView::Status} {status}. @@ -376,8 +389,6 @@ QList<QDeclarativeError> QDeclarativeView::errors() const Regardless of this property, the sizeHint of the view is the initial size of the root item. Note though that since QML may load dynamically, that size may change. - - \sa initialSize() */ void QDeclarativeView::setResizeMode(ResizeMode mode) |