diff options
53 files changed, 519 insertions, 520 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index b378db2..ab5022b 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -607,11 +607,11 @@ void QDeclarativeGridViewPrivate::createHighlight() item->setParent(q->viewport()); highlight = new FxGridItem(item, q); highlightXAnimator = new QDeclarativeEaseFollow(q); - highlightXAnimator->setTarget(QDeclarativeMetaProperty(highlight->item, QLatin1String("x"))); + highlightXAnimator->setTarget(QDeclarativeProperty(highlight->item, QLatin1String("x"))); highlightXAnimator->setDuration(150); highlightXAnimator->setEnabled(autoHighlight); highlightYAnimator = new QDeclarativeEaseFollow(q); - highlightYAnimator->setTarget(QDeclarativeMetaProperty(highlight->item, QLatin1String("y"))); + highlightYAnimator->setTarget(QDeclarativeProperty(highlight->item, QLatin1String("y"))); highlightYAnimator->setDuration(150); highlightYAnimator->setEnabled(autoHighlight); changed = true; diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index bd2f4fc..e6b6f2a 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -804,13 +804,13 @@ void QDeclarativeListViewPrivate::createHighlight() highlight->item->setWidth(currentItem->item->width()); const QLatin1String posProp(orient == QDeclarativeListView::Vertical ? "y" : "x"); highlightPosAnimator = new QDeclarativeEaseFollow(q); - highlightPosAnimator->setTarget(QDeclarativeMetaProperty(highlight->item, posProp)); + highlightPosAnimator->setTarget(QDeclarativeProperty(highlight->item, posProp)); highlightPosAnimator->setVelocity(highlightMoveSpeed); highlightPosAnimator->setEnabled(autoHighlight); const QLatin1String sizeProp(orient == QDeclarativeListView::Vertical ? "height" : "width"); highlightSizeAnimator = new QDeclarativeEaseFollow(q); highlightSizeAnimator->setVelocity(highlightResizeSpeed); - highlightSizeAnimator->setTarget(QDeclarativeMetaProperty(highlight->item, sizeProp)); + highlightSizeAnimator->setTarget(QDeclarativeProperty(highlight->item, sizeProp)); highlightSizeAnimator->setEnabled(autoHighlight); changed = true; } diff --git a/src/declarative/qml/qdeclarativebinding.cpp b/src/declarative/qml/qdeclarativebinding.cpp index 720c562..cecca65 100644 --- a/src/declarative/qml/qdeclarativebinding.cpp +++ b/src/declarative/qml/qdeclarativebinding.cpp @@ -97,7 +97,7 @@ QDeclarativeBinding::~QDeclarativeBinding() { } -void QDeclarativeBinding::setTarget(const QDeclarativeMetaProperty &prop) +void QDeclarativeBinding::setTarget(const QDeclarativeProperty &prop) { Q_D(QDeclarativeBinding); d->bindingData()->property = prop; @@ -105,13 +105,13 @@ void QDeclarativeBinding::setTarget(const QDeclarativeMetaProperty &prop) update(); } -QDeclarativeMetaProperty QDeclarativeBinding::property() const +QDeclarativeProperty QDeclarativeBinding::property() const { Q_D(const QDeclarativeBinding); return d->bindingData()->property; } -void QDeclarativeBinding::update(QDeclarativeMetaPropertyPrivate::WriteFlags flags) +void QDeclarativeBinding::update(QDeclarativePropertyPrivate::WriteFlags flags) { Q_D(QDeclarativeBinding); @@ -161,7 +161,7 @@ void QDeclarativeBinding::update(QDeclarativeMetaPropertyPrivate::WriteFlags fla data->error.setDescription(QLatin1String("Unable to assign [undefined] to ") + QLatin1String(QMetaType::typeName(data->property.propertyType()))); } else if (!isUndefined && data->property.object() && - !QDeclarativeMetaPropertyPrivate::write(data->property, value, flags)) { + !QDeclarativePropertyPrivate::write(data->property, value, flags)) { QUrl url = QUrl(data->url); int line = data->line; @@ -204,7 +204,7 @@ void QDeclarativeBindingPrivate::emitValueChanged() q->update(); } -void QDeclarativeBinding::setEnabled(bool e, QDeclarativeMetaPropertyPrivate::WriteFlags flags) +void QDeclarativeBinding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteFlags flags) { Q_D(QDeclarativeBinding); d->bindingData()->enabled = e; @@ -300,7 +300,7 @@ QString QDeclarativeAbstractBinding::expression() const return QLatin1String("<Unknown>"); } -void QDeclarativeAbstractBinding::setEnabled(bool e, QDeclarativeMetaPropertyPrivate::WriteFlags) +void QDeclarativeAbstractBinding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteFlags) { if (e) m_mePtr = 0; } diff --git a/src/declarative/qml/qdeclarativebinding_p.h b/src/declarative/qml/qdeclarativebinding_p.h index ac174fa..f66b9c7 100644 --- a/src/declarative/qml/qdeclarativebinding_p.h +++ b/src/declarative/qml/qdeclarativebinding_p.h @@ -56,8 +56,8 @@ #include "qdeclarative.h" #include "qdeclarativepropertyvaluesource.h" #include "qdeclarativeexpression.h" -#include "qdeclarativemetaproperty.h" -#include "qdeclarativemetaproperty_p.h" +#include "qdeclarativeproperty.h" +#include "qdeclarativeproperty_p.h" #include <QtCore/QObject> #include <QtCore/QMetaProperty> @@ -74,12 +74,12 @@ public: virtual QString expression() const; - void setEnabled(bool e) { setEnabled(e, QDeclarativeMetaPropertyPrivate::DontRemoveBinding); } - virtual void setEnabled(bool, QDeclarativeMetaPropertyPrivate::WriteFlags) = 0; + void setEnabled(bool e) { setEnabled(e, QDeclarativePropertyPrivate::DontRemoveBinding); } + virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags) = 0; virtual int propertyIndex() = 0; - void update() { update(QDeclarativeMetaPropertyPrivate::DontRemoveBinding); } - virtual void update(QDeclarativeMetaPropertyPrivate::WriteFlags) = 0; + void update() { update(QDeclarativePropertyPrivate::DontRemoveBinding); } + virtual void update(QDeclarativePropertyPrivate::WriteFlags) = 0; void addToObject(QObject *); void removeFromObject(); @@ -89,8 +89,8 @@ protected: private: friend class QDeclarativeDeclarativeData; - friend class QDeclarativeMetaProperty; - friend class QDeclarativeMetaPropertyPrivate; + friend class QDeclarativeProperty; + friend class QDeclarativePropertyPrivate; friend class QDeclarativeVME; QObject *m_object; @@ -110,19 +110,19 @@ public: QObject *parent); ~QDeclarativeBinding(); - void setTarget(const QDeclarativeMetaProperty &); - QDeclarativeMetaProperty property() const; + void setTarget(const QDeclarativeProperty &); + QDeclarativeProperty property() const; bool enabled() const; // Inherited from QDeclarativeAbstractBinding - virtual void setEnabled(bool, QDeclarativeMetaPropertyPrivate::WriteFlags flags); + virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags flags); virtual int propertyIndex(); - virtual void update(QDeclarativeMetaPropertyPrivate::WriteFlags flags); + virtual void update(QDeclarativePropertyPrivate::WriteFlags flags); virtual QString expression() const; public Q_SLOTS: - void update() { update(QDeclarativeMetaPropertyPrivate::DontRemoveBinding); } + void update() { update(QDeclarativePropertyPrivate::DontRemoveBinding); } protected: void emitValueChanged(); diff --git a/src/declarative/qml/qdeclarativebinding_p_p.h b/src/declarative/qml/qdeclarativebinding_p_p.h index ac88400..041103c 100644 --- a/src/declarative/qml/qdeclarativebinding_p_p.h +++ b/src/declarative/qml/qdeclarativebinding_p_p.h @@ -55,7 +55,7 @@ #include "qdeclarativebinding_p.h" -#include "qdeclarativemetaproperty.h" +#include "qdeclarativeproperty.h" #include "qdeclarativeexpression_p.h" QT_BEGIN_NAMESPACE @@ -69,7 +69,7 @@ public: bool updating:1; bool enabled:1; - QDeclarativeMetaProperty property; + QDeclarativeProperty property; virtual void refresh(); }; diff --git a/src/declarative/qml/qdeclarativecompiledbindings.cpp b/src/declarative/qml/qdeclarativecompiledbindings.cpp index a88f02e..17937fd 100644 --- a/src/declarative/qml/qdeclarativecompiledbindings.cpp +++ b/src/declarative/qml/qdeclarativecompiledbindings.cpp @@ -109,9 +109,9 @@ public: scope(0), target(0), parent(0) {} // Inherited from QDeclarativeAbstractBinding - virtual void setEnabled(bool, QDeclarativeMetaPropertyPrivate::WriteFlags flags); + virtual void setEnabled(bool, QDeclarativePropertyPrivate::WriteFlags flags); virtual int propertyIndex(); - virtual void update(QDeclarativeMetaPropertyPrivate::WriteFlags flags); + virtual void update(QDeclarativePropertyPrivate::WriteFlags flags); virtual void destroy(); int index:30; @@ -244,7 +244,7 @@ QDeclarativeAbstractBinding *QDeclarativeCompiledBindings::configBinding(int ind return rv; } -void QDeclarativeCompiledBindingsPrivate::Binding::setEnabled(bool e, QDeclarativeMetaPropertyPrivate::WriteFlags flags) +void QDeclarativeCompiledBindingsPrivate::Binding::setEnabled(bool e, QDeclarativePropertyPrivate::WriteFlags flags) { if (e) { addToObject(target); @@ -267,7 +267,7 @@ int QDeclarativeCompiledBindingsPrivate::Binding::propertyIndex() return property & 0xFFFF; } -void QDeclarativeCompiledBindingsPrivate::Binding::update(QDeclarativeMetaPropertyPrivate::WriteFlags) +void QDeclarativeCompiledBindingsPrivate::Binding::update(QDeclarativePropertyPrivate::WriteFlags) { parent->run(this); } @@ -324,7 +324,7 @@ void QDeclarativeCompiledBindingsPrivate::run(Binding *binding) run(binding->index, cp, binding, binding->scope, target); vt->write(binding->target, binding->property & 0xFFFF, - QDeclarativeMetaPropertyPrivate::DontRemoveBinding); + QDeclarativePropertyPrivate::DontRemoveBinding); } else { run(binding->index, cp, binding, binding->scope, binding->target); } @@ -1701,7 +1701,7 @@ bool QDeclarativeBindingCompilerPrivate::compile(QDeclarativeJS::AST::Node *node const QMetaObject *from = type.metaObject; const QMetaObject *to = engine->rawMetaObjectForType(destination->type); - if (QDeclarativeMetaPropertyPrivate::canConvert(from, to)) + if (QDeclarativePropertyPrivate::canConvert(from, to)) type.type = destination->type; } diff --git a/src/declarative/qml/qdeclarativecompiler.cpp b/src/declarative/qml/qdeclarativecompiler.cpp index 9ac65f9..9dc090b 100644 --- a/src/declarative/qml/qdeclarativecompiler.cpp +++ b/src/declarative/qml/qdeclarativecompiler.cpp @@ -58,7 +58,7 @@ #include "parser/qdeclarativejsast_p.h" #include "qdeclarativevmemetaobject_p.h" #include "qdeclarativeexpression_p.h" -#include "qdeclarativemetaproperty_p.h" +#include "qdeclarativeproperty_p.h" #include "qdeclarativerewrite_p.h" #include "qdeclarativescriptstring.h" #include "qdeclarativeglobal_p.h" @@ -2036,7 +2036,7 @@ bool QDeclarativeCompiler::buildPropertyObjectAssignment(QDeclarativeParser::Pro if (propertyMetaObject) { const QMetaObject *c = v->object->metatype; while(c) { - isAssignable |= (QDeclarativeMetaPropertyPrivate::equal(c, propertyMetaObject)); + isAssignable |= (QDeclarativePropertyPrivate::equal(c, propertyMetaObject)); c = c->superClass(); } } @@ -2619,7 +2619,7 @@ int QDeclarativeCompiler::genValueTypeData(QDeclarativeParser::Property *valueTy QDeclarativeParser::Property *prop) { QByteArray data = - QDeclarativeMetaPropertyPrivate::saveValueType(prop->parent->metaObject(), prop->index, + QDeclarativePropertyPrivate::saveValueType(prop->parent->metaObject(), prop->index, QDeclarativeEnginePrivate::get(engine)->valueTypes[prop->type]->metaObject(), valueTypeProp->index); // valueTypeProp->index, valueTypeProp->type); @@ -2629,7 +2629,7 @@ int QDeclarativeCompiler::genValueTypeData(QDeclarativeParser::Property *valueTy int QDeclarativeCompiler::genPropertyData(QDeclarativeParser::Property *prop) { - return output->indexForByteArray(QDeclarativeMetaPropertyPrivate::saveProperty(prop->parent->metaObject(), prop->index)); + return output->indexForByteArray(QDeclarativePropertyPrivate::saveProperty(prop->parent->metaObject(), prop->index)); } bool QDeclarativeCompiler::completeComponentBuild() @@ -2735,7 +2735,7 @@ bool QDeclarativeCompiler::canCoerce(int to, QDeclarativeParser::Object *from) const QMetaObject *fromMo = from->metaObject(); while (fromMo) { - if (QDeclarativeMetaPropertyPrivate::equal(fromMo, toMo)) + if (QDeclarativePropertyPrivate::equal(fromMo, toMo)) return true; fromMo = fromMo->superClass(); } @@ -2754,7 +2754,7 @@ bool QDeclarativeCompiler::canCoerce(int to, int from) QDeclarativeEnginePrivate::get(engine)->rawMetaObjectForType(from); while (fromMo) { - if (QDeclarativeMetaPropertyPrivate::equal(fromMo, toMo)) + if (QDeclarativePropertyPrivate::equal(fromMo, toMo)) return true; fromMo = fromMo->superClass(); } diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp index aaf36e0..fe63ad2 100644 --- a/src/declarative/qml/qdeclarativecomponent.cpp +++ b/src/declarative/qml/qdeclarativecomponent.cpp @@ -698,8 +698,8 @@ void QDeclarativeComponentPrivate::complete(QDeclarativeEnginePrivate *enginePri state->bindValues.at(ii); for (int jj = 0; jj < bv.count; ++jj) { if(bv.at(jj)) - bv.at(jj)->setEnabled(true, QDeclarativeMetaPropertyPrivate::BypassInterceptor | - QDeclarativeMetaPropertyPrivate::DontRemoveBinding); + bv.at(jj)->setEnabled(true, QDeclarativePropertyPrivate::BypassInterceptor | + QDeclarativePropertyPrivate::DontRemoveBinding); } QDeclarativeEnginePrivate::clear(bv); } diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index 4435a5b..8abea4e 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -49,7 +49,6 @@ #include "qdeclarativecontext.h" #include "qdeclarativeexpression.h" #include "qdeclarativecomponent.h" -#include "qdeclarativemetaproperty_p.h" #include "qdeclarativebinding_p_p.h" #include "qdeclarativevme_p.h" #include "qdeclarativeenginedebug_p.h" @@ -110,7 +109,7 @@ #define CSIDL_APPDATA 0x001a // <username>\Application Data #endif -Q_DECLARE_METATYPE(QDeclarativeMetaProperty) +Q_DECLARE_METATYPE(QDeclarativeProperty) QT_BEGIN_NAMESPACE diff --git a/src/declarative/qml/qdeclarativeengine_p.h b/src/declarative/qml/qdeclarativeengine_p.h index c4a40c5..2364315 100644 --- a/src/declarative/qml/qdeclarativeengine_p.h +++ b/src/declarative/qml/qdeclarativeengine_p.h @@ -62,7 +62,7 @@ #include "qdeclarativevaluetype_p.h" #include "qdeclarativecontext.h" #include "qdeclarativeexpression.h" -#include "qdeclarativemetaproperty_p.h" +#include "qdeclarativeproperty_p.h" #include "qdeclarativepropertycache_p.h" #include "qdeclarativeobjectscriptclass_p.h" #include "qdeclarativecontextscriptclass_p.h" diff --git a/src/declarative/qml/qdeclarativeenginedebug.cpp b/src/declarative/qml/qdeclarativeenginedebug.cpp index 2ae0b54..09882cb 100644 --- a/src/declarative/qml/qdeclarativeenginedebug.cpp +++ b/src/declarative/qml/qdeclarativeenginedebug.cpp @@ -44,8 +44,8 @@ #include "qdeclarativeboundsignal_p.h" #include "qdeclarativeengine.h" #include "qdeclarativemetatype_p.h" -#include "qdeclarativemetaproperty.h" -#include "qdeclarativemetaproperty_p.h" +#include "qdeclarativeproperty.h" +#include "qdeclarativeproperty_p.h" #include "qdeclarativebinding_p.h" #include "qdeclarativecontext_p.h" #include "qdeclarativewatcher_p.h" @@ -110,7 +110,7 @@ QDeclarativeEngineDebugServer::propertyData(QObject *obj, int propIdx) rv.name = QString::fromUtf8(prop.name()); rv.hasNotifySignal = prop.hasNotifySignal(); QDeclarativeAbstractBinding *binding = - QDeclarativeMetaPropertyPrivate::binding(QDeclarativeMetaProperty(obj, rv.name)); + QDeclarativePropertyPrivate::binding(QDeclarativeProperty(obj, rv.name)); if (binding) rv.binding = binding->expression(); diff --git a/src/declarative/qml/qdeclarativelist.cpp b/src/declarative/qml/qdeclarativelist.cpp index 4c9586c..af720d7 100644 --- a/src/declarative/qml/qdeclarativelist.cpp +++ b/src/declarative/qml/qdeclarativelist.cpp @@ -42,7 +42,7 @@ #include "qdeclarativelist.h" #include "qdeclarativelist_p.h" #include "qdeclarativeengine_p.h" -#include "qdeclarativemetaproperty_p.h" +#include "qdeclarativeproperty_p.h" QT_BEGIN_NAMESPACE @@ -174,7 +174,7 @@ bool QDeclarativeListReference::append(QObject *o) const { if (!canAppend()) return false; - if (o && !QDeclarativeMetaPropertyPrivate::canConvert(o->metaObject(), d->elementType)) + if (o && !QDeclarativePropertyPrivate::canConvert(o->metaObject(), d->elementType)) return false; d->property.append(&d->property, o); diff --git a/src/declarative/qml/qdeclarativemetatype.cpp b/src/declarative/qml/qdeclarativemetatype.cpp index e87f8ba..abbb9d6 100644 --- a/src/declarative/qml/qdeclarativemetatype.cpp +++ b/src/declarative/qml/qdeclarativemetatype.cpp @@ -619,7 +619,7 @@ QDeclarativeType *QDeclarativeMetaType::qmlType(const QByteArray &name, int vers QList<QDeclarativeType*> types = data->nameToType.values(name); foreach (QDeclarativeType *t, types) { - // XXX version_major<0 just a kludge for QDeclarativeMetaPropertyPrivate::initProperty + // XXX version_major<0 just a kludge for QDeclarativePropertyPrivate::initProperty if (version_major<0 || t->availableInVersion(version_major,version_minor)) return t; } diff --git a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp index 50fe5c0..542f417 100644 --- a/src/declarative/qml/qdeclarativeobjectscriptclass.cpp +++ b/src/declarative/qml/qdeclarativeobjectscriptclass.cpp @@ -338,7 +338,7 @@ void QDeclarativeObjectScriptClass::setProperty(QObject *obj, } } - QDeclarativeAbstractBinding *delBinding = QDeclarativeMetaPropertyPrivate::setBinding(obj, *lastData, 0); + QDeclarativeAbstractBinding *delBinding = QDeclarativePropertyPrivate::setBinding(obj, *lastData, 0); if (delBinding) delBinding->destroy(); @@ -348,7 +348,7 @@ void QDeclarativeObjectScriptClass::setProperty(QObject *obj, } else { // ### Can well known types be optimized? QVariant v = QDeclarativeScriptClass::toVariant(engine, value); - QDeclarativeMetaPropertyPrivate::write(obj, *lastData, v, evalContext); + QDeclarativePropertyPrivate::write(obj, *lastData, v, evalContext); } } diff --git a/src/declarative/qml/qdeclarativemetaproperty.cpp b/src/declarative/qml/qdeclarativeproperty.cpp index a976140..88f356d 100644 --- a/src/declarative/qml/qdeclarativemetaproperty.cpp +++ b/src/declarative/qml/qdeclarativeproperty.cpp @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#include "qdeclarativemetaproperty.h" -#include "qdeclarativemetaproperty_p.h" +#include "qdeclarativeproperty.h" +#include "qdeclarativeproperty_p.h" #include "qdeclarativecompositetypedata_p.h" #include "qdeclarative.h" @@ -62,32 +62,32 @@ QT_BEGIN_NAMESPACE /*! - \class QDeclarativeMetaProperty - \brief The QDeclarativeMetaProperty class abstracts accessing QML properties. + \class QDeclarativeProperty + \brief The QDeclarativeProperty class abstracts accessing QML properties. \internal */ /*! - Create an invalid QDeclarativeMetaProperty. + Create an invalid QDeclarativeProperty. */ -QDeclarativeMetaProperty::QDeclarativeMetaProperty() -: d(new QDeclarativeMetaPropertyPrivate) +QDeclarativeProperty::QDeclarativeProperty() +: d(new QDeclarativePropertyPrivate) { d->q = this; } /*! \internal */ -QDeclarativeMetaProperty::~QDeclarativeMetaProperty() +QDeclarativeProperty::~QDeclarativeProperty() { delete d; d = 0; } /*! - Creates a QDeclarativeMetaProperty for the default property of \a obj. If there is no - default property, an invalid QDeclarativeMetaProperty will be created. + Creates a QDeclarativeProperty for the default property of \a obj. If there is no + default property, an invalid QDeclarativeProperty will be created. */ -QDeclarativeMetaProperty::QDeclarativeMetaProperty(QObject *obj) -: d(new QDeclarativeMetaPropertyPrivate) +QDeclarativeProperty::QDeclarativeProperty(QObject *obj) +: d(new QDeclarativePropertyPrivate) { d->q = this; d->initDefault(obj); @@ -95,11 +95,11 @@ QDeclarativeMetaProperty::QDeclarativeMetaProperty(QObject *obj) /*! \internal - Creates a QDeclarativeMetaProperty for the default property of \a obj. If there is no - default property, an invalid QDeclarativeMetaProperty will be created. + Creates a QDeclarativeProperty for the default property of \a obj. If there is no + default property, an invalid QDeclarativeProperty will be created. */ -QDeclarativeMetaProperty::QDeclarativeMetaProperty(QObject *obj, QDeclarativeContext *ctxt) -: d(new QDeclarativeMetaPropertyPrivate) +QDeclarativeProperty::QDeclarativeProperty(QObject *obj, QDeclarativeContext *ctxt) +: d(new QDeclarativePropertyPrivate) { d->q = this; d->context = ctxt; @@ -109,7 +109,7 @@ QDeclarativeMetaProperty::QDeclarativeMetaProperty(QObject *obj, QDeclarativeCon /*! Initialize from the default property of \a obj */ -void QDeclarativeMetaPropertyPrivate::initDefault(QObject *obj) +void QDeclarativePropertyPrivate::initDefault(QObject *obj) { if (!obj) return; @@ -123,10 +123,10 @@ void QDeclarativeMetaPropertyPrivate::initDefault(QObject *obj) } /*! - Creates a QDeclarativeMetaProperty for the property \a name of \a obj. + Creates a QDeclarativeProperty for the property \a name of \a obj. */ -QDeclarativeMetaProperty::QDeclarativeMetaProperty(QObject *obj, const QString &name) -: d(new QDeclarativeMetaPropertyPrivate) +QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name) +: d(new QDeclarativePropertyPrivate) { d->q = this; d->initProperty(obj, name); @@ -135,10 +135,10 @@ QDeclarativeMetaProperty::QDeclarativeMetaProperty(QObject *obj, const QString & /*! \internal - Creates a QDeclarativeMetaProperty for the property \a name of \a obj. + Creates a QDeclarativeProperty for the property \a name of \a obj. */ -QDeclarativeMetaProperty::QDeclarativeMetaProperty(QObject *obj, const QString &name, QDeclarativeContext *ctxt) -: d(new QDeclarativeMetaPropertyPrivate) +QDeclarativeProperty::QDeclarativeProperty(QObject *obj, const QString &name, QDeclarativeContext *ctxt) +: d(new QDeclarativePropertyPrivate) { d->q = this; d->context = ctxt; @@ -148,7 +148,7 @@ QDeclarativeMetaProperty::QDeclarativeMetaProperty(QObject *obj, const QString & Q_GLOBAL_STATIC(QDeclarativeValueTypeFactory, qmlValueTypes); -void QDeclarativeMetaPropertyPrivate::initProperty(QObject *obj, const QString &name) +void QDeclarativePropertyPrivate::initProperty(QObject *obj, const QString &name) { if (!obj) return; @@ -256,14 +256,14 @@ void QDeclarativeMetaPropertyPrivate::initProperty(QObject *obj, const QString & /*! Create a copy of \a other. */ -QDeclarativeMetaProperty::QDeclarativeMetaProperty(const QDeclarativeMetaProperty &other) -: d(new QDeclarativeMetaPropertyPrivate(*other.d)) +QDeclarativeProperty::QDeclarativeProperty(const QDeclarativeProperty &other) +: d(new QDeclarativePropertyPrivate(*other.d)) { d->q = this; } /*! - \enum QDeclarativeMetaProperty::PropertyTypeCategory + \enum QDeclarativeProperty::PropertyTypeCategory This enum specifies a category of QML property. @@ -274,7 +274,7 @@ QDeclarativeMetaProperty::QDeclarativeMetaProperty(const QDeclarativeMetaPropert */ /*! - \enum QDeclarativeMetaProperty::Type + \enum QDeclarativeProperty::Type This enum specifies a type of QML property. @@ -287,32 +287,32 @@ QDeclarativeMetaProperty::QDeclarativeMetaProperty(const QDeclarativeMetaPropert /*! Returns the property category. */ -QDeclarativeMetaProperty::PropertyTypeCategory QDeclarativeMetaProperty::propertyTypeCategory() const +QDeclarativeProperty::PropertyTypeCategory QDeclarativeProperty::propertyTypeCategory() const { return d->propertyTypeCategory(); } -QDeclarativeMetaProperty::PropertyTypeCategory -QDeclarativeMetaPropertyPrivate::propertyTypeCategory() const +QDeclarativeProperty::PropertyTypeCategory +QDeclarativePropertyPrivate::propertyTypeCategory() const { uint type = q->type(); - if (type & QDeclarativeMetaProperty::ValueTypeProperty) { - return QDeclarativeMetaProperty::Normal; - } else if (type & QDeclarativeMetaProperty::Property) { + if (type & QDeclarativeProperty::ValueTypeProperty) { + return QDeclarativeProperty::Normal; + } else if (type & QDeclarativeProperty::Property) { int type = propertyType(); if (type == QVariant::Invalid) - return QDeclarativeMetaProperty::InvalidCategory; + return QDeclarativeProperty::InvalidCategory; else if ((uint)type < QVariant::UserType) - return QDeclarativeMetaProperty::Normal; + return QDeclarativeProperty::Normal; else if (core.flags & QDeclarativePropertyCache::Data::IsQObjectDerived) - return QDeclarativeMetaProperty::Object; + return QDeclarativeProperty::Object; else if (core.flags & QDeclarativePropertyCache::Data::IsQList) - return QDeclarativeMetaProperty::List; + return QDeclarativeProperty::List; else - return QDeclarativeMetaProperty::Normal; + return QDeclarativeProperty::Normal; } else { - return QDeclarativeMetaProperty::InvalidCategory; + return QDeclarativeProperty::InvalidCategory; } } @@ -320,7 +320,7 @@ QDeclarativeMetaPropertyPrivate::propertyTypeCategory() const Returns the type name of the property, or 0 if the property has no type name. */ -const char *QDeclarativeMetaProperty::propertyTypeName() const +const char *QDeclarativeProperty::propertyTypeName() const { if (type() & ValueTypeProperty) { @@ -343,10 +343,10 @@ const char *QDeclarativeMetaProperty::propertyTypeName() const } /*! - Returns true if \a other and this QDeclarativeMetaProperty represent the same + Returns true if \a other and this QDeclarativeProperty represent the same property. */ -bool QDeclarativeMetaProperty::operator==(const QDeclarativeMetaProperty &other) const +bool QDeclarativeProperty::operator==(const QDeclarativeProperty &other) const { // category is intentially omitted here as it is generated // from the other members @@ -359,17 +359,17 @@ bool QDeclarativeMetaProperty::operator==(const QDeclarativeMetaProperty &other) Returns the QVariant type of the property, or QVariant::Invalid if the property has no QVariant type. */ -int QDeclarativeMetaProperty::propertyType() const +int QDeclarativeProperty::propertyType() const { return d->propertyType(); } -int QDeclarativeMetaPropertyPrivate::propertyType() const +int QDeclarativePropertyPrivate::propertyType() const { uint type = q->type(); - if (type & QDeclarativeMetaProperty::ValueTypeProperty) { + if (type & QDeclarativeProperty::ValueTypeProperty) { return valueType.valueTypePropType; - } else if (type & QDeclarativeMetaProperty::Property) { + } else if (type & QDeclarativeProperty::Property) { if (core.propType == (int)QVariant::LastType) return qMetaTypeId<QVariant>(); else @@ -382,7 +382,7 @@ int QDeclarativeMetaPropertyPrivate::propertyType() const /*! Returns the type of the property. */ -QDeclarativeMetaProperty::Type QDeclarativeMetaProperty::type() const +QDeclarativeProperty::Type QDeclarativeProperty::type() const { if (d->core.flags & QDeclarativePropertyCache::Data::IsFunction) return SignalProperty; @@ -395,33 +395,33 @@ QDeclarativeMetaProperty::Type QDeclarativeMetaProperty::type() const } /*! - Returns true if this QDeclarativeMetaProperty represents a regular Qt property. + Returns true if this QDeclarativeProperty represents a regular Qt property. */ -bool QDeclarativeMetaProperty::isProperty() const +bool QDeclarativeProperty::isProperty() const { return type() & Property; } /*! - Returns true if this QDeclarativeMetaProperty represents a default property. + Returns true if this QDeclarativeProperty represents a default property. */ -bool QDeclarativeMetaProperty::isDefault() const +bool QDeclarativeProperty::isDefault() const { return type() & Default; } /*! - Returns the QDeclarativeMetaProperty's QObject. + Returns the QDeclarativeProperty's QObject. */ -QObject *QDeclarativeMetaProperty::object() const +QObject *QDeclarativeProperty::object() const { return d->object; } /*! - Assign \a other to this QDeclarativeMetaProperty. + Assign \a other to this QDeclarativeProperty. */ -QDeclarativeMetaProperty &QDeclarativeMetaProperty::operator=(const QDeclarativeMetaProperty &other) +QDeclarativeProperty &QDeclarativeProperty::operator=(const QDeclarativeProperty &other) { d->context = other.d->context; d->object = other.d->object; @@ -439,9 +439,9 @@ QDeclarativeMetaProperty &QDeclarativeMetaProperty::operator=(const QDeclarative /*! Returns true if the property is writable, otherwise false. */ -bool QDeclarativeMetaProperty::isWritable() const +bool QDeclarativeProperty::isWritable() const { - QDeclarativeMetaProperty::PropertyTypeCategory category = propertyTypeCategory(); + QDeclarativeProperty::PropertyTypeCategory category = propertyTypeCategory(); if (!d->object) return false; @@ -458,7 +458,7 @@ bool QDeclarativeMetaProperty::isWritable() const /*! Returns true if the property is designable, otherwise false. */ -bool QDeclarativeMetaProperty::isDesignable() const +bool QDeclarativeProperty::isDesignable() const { if (type() & Property && d->core.isValid() && d->object) return d->object->metaObject()->property(d->core.coreIndex).isDesignable(); @@ -469,7 +469,7 @@ bool QDeclarativeMetaProperty::isDesignable() const /*! Returns true if the property is resettable, otherwise false. */ -bool QDeclarativeMetaProperty::isResettable() const +bool QDeclarativeProperty::isResettable() const { if (type() & Property && d->core.isValid() && d->object) return d->core.flags & QDeclarativePropertyCache::Data::IsResettable; @@ -478,10 +478,10 @@ bool QDeclarativeMetaProperty::isResettable() const } /*! - Returns true if the QDeclarativeMetaProperty refers to a valid property, otherwise + Returns true if the QDeclarativeProperty refers to a valid property, otherwise false. */ -bool QDeclarativeMetaProperty::isValid() const +bool QDeclarativeProperty::isValid() const { return type() != Invalid; } @@ -489,7 +489,7 @@ bool QDeclarativeMetaProperty::isValid() const /*! Return the name of this QML property. */ -QString QDeclarativeMetaProperty::name() const +QString QDeclarativeProperty::name() const { if (!d->isNameCached) { // ### @@ -525,7 +525,7 @@ QString QDeclarativeMetaProperty::name() const Returns the \l{QMetaProperty} {Qt property} associated with this QML property. */ -QMetaProperty QDeclarativeMetaProperty::property() const +QMetaProperty QDeclarativeProperty::property() const { if (type() & Property && d->core.isValid() && d->object) return d->object->metaObject()->property(d->core.coreIndex); @@ -537,7 +537,7 @@ QMetaProperty QDeclarativeMetaProperty::property() const Return the QMetaMethod for this property if it is a SignalProperty, otherwise returns an invalid QMetaMethod. */ -QMetaMethod QDeclarativeMetaProperty::method() const +QMetaMethod QDeclarativeProperty::method() const { if (type() & SignalProperty && d->object) return d->object->metaObject()->method(d->core.coreIndex); @@ -551,7 +551,7 @@ QMetaMethod QDeclarativeMetaProperty::method() const exists. */ QDeclarativeAbstractBinding * -QDeclarativeMetaPropertyPrivate::binding(const QDeclarativeMetaProperty &that) +QDeclarativePropertyPrivate::binding(const QDeclarativeProperty &that) { if (!that.isProperty() || !that.d->object) return 0; @@ -587,7 +587,7 @@ QDeclarativeMetaPropertyPrivate::binding(const QDeclarativeMetaProperty &that) the binding sets the intial value, it will use these flags for the write). */ QDeclarativeAbstractBinding * -QDeclarativeMetaPropertyPrivate::setBinding(const QDeclarativeMetaProperty &that, +QDeclarativePropertyPrivate::setBinding(const QDeclarativeProperty &that, QDeclarativeAbstractBinding *newBinding, WriteFlags flags) { @@ -601,7 +601,7 @@ QDeclarativeMetaPropertyPrivate::setBinding(const QDeclarativeMetaProperty &that } QDeclarativeAbstractBinding * -QDeclarativeMetaPropertyPrivate::setBinding(QObject *object, const QDeclarativePropertyCache::Data &core, +QDeclarativePropertyPrivate::setBinding(QObject *object, const QDeclarativePropertyCache::Data &core, QDeclarativeAbstractBinding *newBinding, WriteFlags flags) { QDeclarativeDeclarativeData *data = QDeclarativeDeclarativeData::get(object, 0 != newBinding); @@ -634,9 +634,9 @@ QDeclarativeMetaPropertyPrivate::setBinding(QObject *object, const QDeclarativeP signal expression exists. */ QDeclarativeExpression * -QDeclarativeMetaPropertyPrivate::signalExpression(const QDeclarativeMetaProperty &that) +QDeclarativePropertyPrivate::signalExpression(const QDeclarativeProperty &that) { - if (!(that.type() & QDeclarativeMetaProperty::SignalProperty)) + if (!(that.type() & QDeclarativeProperty::SignalProperty)) return 0; const QObjectList &children = that.d->object->children(); @@ -660,10 +660,10 @@ QDeclarativeMetaPropertyPrivate::signalExpression(const QDeclarativeMetaProperty assumed by the caller. */ QDeclarativeExpression * -QDeclarativeMetaPropertyPrivate::setSignalExpression(const QDeclarativeMetaProperty &that, +QDeclarativePropertyPrivate::setSignalExpression(const QDeclarativeProperty &that, QDeclarativeExpression *expr) { - if (!(that.type() & QDeclarativeMetaProperty::SignalProperty)) { + if (!(that.type() & QDeclarativeProperty::SignalProperty)) { delete expr; return 0; } @@ -686,7 +686,7 @@ QDeclarativeMetaPropertyPrivate::setSignalExpression(const QDeclarativeMetaPrope } } -QMetaMethod QDeclarativeMetaPropertyPrivate::findSignal(QObject *obj, const QString &name) +QMetaMethod QDeclarativePropertyPrivate::findSignal(QObject *obj, const QString &name) { const QMetaObject *mo = obj->metaObject(); @@ -706,7 +706,7 @@ QMetaMethod QDeclarativeMetaPropertyPrivate::findSignal(QObject *obj, const QStr /*! Returns the property value. */ -QVariant QDeclarativeMetaProperty::read() const +QVariant QDeclarativeProperty::read() const { if (!d->object) return QVariant(); @@ -723,10 +723,10 @@ QVariant QDeclarativeMetaProperty::read() const return QVariant(); } -QVariant QDeclarativeMetaPropertyPrivate::readValueProperty() +QVariant QDeclarativePropertyPrivate::readValueProperty() { uint type = q->type(); - if(type & QDeclarativeMetaProperty::ValueTypeProperty) { + if(type & QDeclarativeProperty::ValueTypeProperty) { QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context); QDeclarativeValueType *valueType = 0; @@ -759,7 +759,7 @@ QVariant QDeclarativeMetaPropertyPrivate::readValueProperty() //### //writeEnumProperty MIRRORS the relelvant bit of QMetaProperty::write AND MUST BE KEPT IN SYNC! //### -bool QDeclarativeMetaPropertyPrivate::writeEnumProperty(const QMetaProperty &prop, int idx, QObject *object, const QVariant &value, int flags) +bool QDeclarativePropertyPrivate::writeEnumProperty(const QMetaProperty &prop, int idx, QObject *object, const QVariant &value, int flags) { if (!object || !prop.isWritable()) return false; @@ -796,7 +796,7 @@ bool QDeclarativeMetaPropertyPrivate::writeEnumProperty(const QMetaProperty &pro return status; } -bool QDeclarativeMetaPropertyPrivate::writeValueProperty(const QVariant &value, WriteFlags flags) +bool QDeclarativePropertyPrivate::writeValueProperty(const QVariant &value, WriteFlags flags) { // Remove any existing bindings on this property if (!(flags & DontRemoveBinding)) { @@ -806,7 +806,7 @@ bool QDeclarativeMetaPropertyPrivate::writeValueProperty(const QVariant &value, bool rv = false; uint type = q->type(); - if (type & QDeclarativeMetaProperty::ValueTypeProperty) { + if (type & QDeclarativeProperty::ValueTypeProperty) { QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(context); QDeclarativeValueType *writeBack = 0; @@ -836,7 +836,7 @@ bool QDeclarativeMetaPropertyPrivate::writeValueProperty(const QVariant &value, return rv; } -bool QDeclarativeMetaPropertyPrivate::write(QObject *object, const QDeclarativePropertyCache::Data &property, +bool QDeclarativePropertyPrivate::write(QObject *object, const QDeclarativePropertyCache::Data &property, const QVariant &value, QDeclarativeContext *context, WriteFlags flags) { @@ -991,7 +991,7 @@ bool QDeclarativeMetaPropertyPrivate::write(QObject *object, const QDeclarativeP return true; } -const QMetaObject *QDeclarativeMetaPropertyPrivate::rawMetaObjectForType(QDeclarativeEnginePrivate *engine, int userType) +const QMetaObject *QDeclarativePropertyPrivate::rawMetaObjectForType(QDeclarativeEnginePrivate *engine, int userType) { if (engine) { return engine->rawMetaObjectForType(userType); @@ -1004,15 +1004,15 @@ const QMetaObject *QDeclarativeMetaPropertyPrivate::rawMetaObjectForType(QDeclar /*! Set the property value to \a value. */ -bool QDeclarativeMetaProperty::write(const QVariant &value) const +bool QDeclarativeProperty::write(const QVariant &value) const { - return QDeclarativeMetaPropertyPrivate::write(*this, value, 0); + return QDeclarativePropertyPrivate::write(*this, value, 0); } /*! Resets the property value. */ -bool QDeclarativeMetaProperty::reset() const +bool QDeclarativeProperty::reset() const { if (isResettable()) { void *args[] = { 0 }; @@ -1023,10 +1023,10 @@ bool QDeclarativeMetaProperty::reset() const } } -bool QDeclarativeMetaPropertyPrivate::write(const QDeclarativeMetaProperty &that, +bool QDeclarativePropertyPrivate::write(const QDeclarativeProperty &that, const QVariant &value, WriteFlags flags) { - if (that.d->object && that.type() & QDeclarativeMetaProperty::Property && + if (that.d->object && that.type() & QDeclarativeProperty::Property && that.d->core.isValid() && that.isWritable()) return that.d->writeValueProperty(value, flags); else @@ -1036,7 +1036,7 @@ bool QDeclarativeMetaPropertyPrivate::write(const QDeclarativeMetaProperty &that /*! Returns true if the property has a change notifier signal, otherwise false. */ -bool QDeclarativeMetaProperty::hasChangedNotifier() const +bool QDeclarativeProperty::hasChangedNotifier() const { if (type() & Property && d->object) { return d->object->metaObject()->property(d->core.coreIndex).hasNotifySignal(); @@ -1051,7 +1051,7 @@ bool QDeclarativeMetaProperty::hasChangedNotifier() const Some properties, such as attached properties or those whose value never changes, do not require a change notifier. */ -bool QDeclarativeMetaProperty::needsChangedNotifier() const +bool QDeclarativeProperty::needsChangedNotifier() const { return type() & Property && !property().isConstant(); } @@ -1064,7 +1064,7 @@ bool QDeclarativeMetaProperty::needsChangedNotifier() const change notifier signal, or if the \a dest object does not have the specified \a method. */ -bool QDeclarativeMetaProperty::connectNotifier(QObject *dest, int method) const +bool QDeclarativeProperty::connectNotifier(QObject *dest, int method) const { if (!(type() & Property) || !d->object) return false; @@ -1085,7 +1085,7 @@ bool QDeclarativeMetaProperty::connectNotifier(QObject *dest, int method) const change notifier signal, or if the \a dest object does not have the specified \a slot. */ -bool QDeclarativeMetaProperty::connectNotifier(QObject *dest, const char *slot) const +bool QDeclarativeProperty::connectNotifier(QObject *dest, const char *slot) const { if (!(type() & Property) || !d->object) return false; @@ -1102,18 +1102,18 @@ bool QDeclarativeMetaProperty::connectNotifier(QObject *dest, const char *slot) /*! Return the Qt metaobject index of the property. */ -int QDeclarativeMetaProperty::coreIndex() const +int QDeclarativeProperty::coreIndex() const { return d->core.coreIndex; } -int QDeclarativeMetaPropertyPrivate::valueTypeCoreIndex(const QDeclarativeMetaProperty &that) +int QDeclarativePropertyPrivate::valueTypeCoreIndex(const QDeclarativeProperty &that) { return that.d->valueType.valueTypeCoreIdx; } struct SerializedData { - QDeclarativeMetaProperty::Type type; + QDeclarativeProperty::Type type; QDeclarativePropertyCache::Data core; }; @@ -1121,14 +1121,14 @@ struct ValueTypeSerializedData : public SerializedData { QDeclarativePropertyCache::ValueTypeData valueType; }; -QByteArray QDeclarativeMetaPropertyPrivate::saveValueType(const QMetaObject *metaObject, int index, +QByteArray QDeclarativePropertyPrivate::saveValueType(const QMetaObject *metaObject, int index, const QMetaObject *subObject, int subIndex) { QMetaProperty prop = metaObject->property(index); QMetaProperty subProp = subObject->property(subIndex); ValueTypeSerializedData sd; - sd.type = QDeclarativeMetaProperty::ValueTypeProperty; + sd.type = QDeclarativeProperty::ValueTypeProperty; sd.core.load(metaObject->property(index)); sd.valueType.flags = QDeclarativePropertyCache::Data::flagsForProperty(subProp); sd.valueType.valueTypeCoreIdx = subIndex; @@ -1139,20 +1139,20 @@ QByteArray QDeclarativeMetaPropertyPrivate::saveValueType(const QMetaObject *met return rv; } -QByteArray QDeclarativeMetaPropertyPrivate::saveProperty(const QMetaObject *metaObject, int index) +QByteArray QDeclarativePropertyPrivate::saveProperty(const QMetaObject *metaObject, int index) { SerializedData sd; - sd.type = QDeclarativeMetaProperty::Property; + sd.type = QDeclarativeProperty::Property; sd.core.load(metaObject->property(index)); QByteArray rv((const char *)&sd, sizeof(sd)); return rv; } -QDeclarativeMetaProperty -QDeclarativeMetaPropertyPrivate::restore(const QByteArray &data, QObject *object, QDeclarativeContext *ctxt) +QDeclarativeProperty +QDeclarativePropertyPrivate::restore(const QByteArray &data, QObject *object, QDeclarativeContext *ctxt) { - QDeclarativeMetaProperty prop; + QDeclarativeProperty prop; if (data.isEmpty()) return prop; @@ -1161,9 +1161,9 @@ QDeclarativeMetaPropertyPrivate::restore(const QByteArray &data, QObject *object prop.d->context = ctxt; const SerializedData *sd = (const SerializedData *)data.constData(); - if (sd->type == QDeclarativeMetaProperty::Property) { + if (sd->type == QDeclarativeProperty::Property) { prop.d->core = sd->core; - } else if(sd->type == QDeclarativeMetaProperty::ValueTypeProperty) { + } else if(sd->type == QDeclarativeProperty::ValueTypeProperty) { const ValueTypeSerializedData *vt = (const ValueTypeSerializedData *)sd; prop.d->core = vt->core; prop.d->valueType = vt->valueType; @@ -1175,7 +1175,7 @@ QDeclarativeMetaPropertyPrivate::restore(const QByteArray &data, QObject *object /*! Returns true if lhs and rhs refer to the same metaobject data */ -bool QDeclarativeMetaPropertyPrivate::equal(const QMetaObject *lhs, const QMetaObject *rhs) +bool QDeclarativePropertyPrivate::equal(const QMetaObject *lhs, const QMetaObject *rhs) { return lhs == rhs || (1 && lhs && rhs && lhs->d.stringdata == rhs->d.stringdata); } @@ -1183,7 +1183,7 @@ bool QDeclarativeMetaPropertyPrivate::equal(const QMetaObject *lhs, const QMetaO /*! Returns true if from inherits to. */ -bool QDeclarativeMetaPropertyPrivate::canConvert(const QMetaObject *from, const QMetaObject *to) +bool QDeclarativePropertyPrivate::canConvert(const QMetaObject *from, const QMetaObject *to) { if (from && to == &QObject::staticMetaObject) return true; diff --git a/src/declarative/qml/qdeclarativemetaproperty.h b/src/declarative/qml/qdeclarativeproperty.h index 828749f..be1065e 100644 --- a/src/declarative/qml/qdeclarativemetaproperty.h +++ b/src/declarative/qml/qdeclarativeproperty.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEMETAPROPERTY_H -#define QDECLARATIVEMETAPROPERTY_H +#ifndef QDECLARATIVEPROPERTY_H +#define QDECLARATIVEPROPERTY_H #include <QtCore/qmetaobject.h> @@ -59,8 +59,8 @@ struct QMetaObject; class QDeclarativeContext; class QDeclarativeEngine; -class QDeclarativeMetaPropertyPrivate; -class Q_DECLARATIVE_EXPORT QDeclarativeMetaProperty +class QDeclarativePropertyPrivate; +class Q_DECLARATIVE_EXPORT QDeclarativeProperty { public: enum PropertyTypeCategory { @@ -77,17 +77,17 @@ public: ValueTypeProperty = 0x10 }; - QDeclarativeMetaProperty(); - ~QDeclarativeMetaProperty(); + QDeclarativeProperty(); + ~QDeclarativeProperty(); - QDeclarativeMetaProperty(QObject *); - QDeclarativeMetaProperty(QObject *, QDeclarativeContext *); + QDeclarativeProperty(QObject *); + QDeclarativeProperty(QObject *, QDeclarativeContext *); - QDeclarativeMetaProperty(QObject *, const QString &); - QDeclarativeMetaProperty(QObject *, const QString &, QDeclarativeContext *); + QDeclarativeProperty(QObject *, const QString &); + QDeclarativeProperty(QObject *, const QString &, QDeclarativeContext *); - QDeclarativeMetaProperty(const QDeclarativeMetaProperty &); - QDeclarativeMetaProperty &operator=(const QDeclarativeMetaProperty &); + QDeclarativeProperty(const QDeclarativeProperty &); + QDeclarativeProperty &operator=(const QDeclarativeProperty &); QString name() const; @@ -113,7 +113,7 @@ public: PropertyTypeCategory propertyTypeCategory() const; const char *propertyTypeName() const; - bool operator==(const QDeclarativeMetaProperty &) const; + bool operator==(const QDeclarativeProperty &) const; int coreIndex() const; QMetaProperty property() const; @@ -121,13 +121,13 @@ public: private: friend class QDeclarativeEnginePrivate; - friend class QDeclarativeMetaPropertyPrivate; - QDeclarativeMetaPropertyPrivate *d; + friend class QDeclarativePropertyPrivate; + QDeclarativePropertyPrivate *d; }; -typedef QList<QDeclarativeMetaProperty> QDeclarativeMetaProperties; +typedef QList<QDeclarativeProperty> QDeclarativeProperties; QT_END_NAMESPACE QT_END_HEADER -#endif // QDECLARATIVEMETAPROPERTY_H +#endif // QDECLARATIVEPROPERTY_H diff --git a/src/declarative/qml/qdeclarativemetaproperty_p.h b/src/declarative/qml/qdeclarativeproperty_p.h index a171545..d0ad09c 100644 --- a/src/declarative/qml/qdeclarativemetaproperty_p.h +++ b/src/declarative/qml/qdeclarativeproperty_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QDECLARATIVEMETAPROPERTY_P_H -#define QDECLARATIVEMETAPROPERTY_P_H +#ifndef QDECLARATIVEPROPERTY_P_H +#define QDECLARATIVEPROPERTY_P_H // // W A R N I N G @@ -53,7 +53,7 @@ // We mean it. // -#include "qdeclarativemetaproperty.h" +#include "qdeclarativeproperty.h" #include "qdeclarativepropertycache_p.h" #include "qdeclarativeguard_p.h" @@ -64,23 +64,23 @@ QT_BEGIN_NAMESPACE class QDeclarativeContext; class QDeclarativeEnginePrivate; -class Q_AUTOTEST_EXPORT QDeclarativeMetaPropertyPrivate +class Q_AUTOTEST_EXPORT QDeclarativePropertyPrivate { public: enum WriteFlag { BypassInterceptor = 0x01, DontRemoveBinding = 0x02 }; Q_DECLARE_FLAGS(WriteFlags, WriteFlag) - QDeclarativeMetaPropertyPrivate() + QDeclarativePropertyPrivate() : q(0), context(0), object(0), isDefaultProperty(false), isNameCached(false) {} - QDeclarativeMetaPropertyPrivate(const QDeclarativeMetaPropertyPrivate &other) + QDeclarativePropertyPrivate(const QDeclarativePropertyPrivate &other) : q(0), context(other.context), object(other.object), isDefaultProperty(other.isDefaultProperty), isNameCached(other.isNameCached), core(other.core), nameCache(other.nameCache), valueType(other.valueType) {} - QDeclarativeMetaProperty *q; + QDeclarativeProperty *q; QDeclarativeContext *context; QDeclarativeGuard<QObject> object; @@ -98,7 +98,7 @@ public: QMetaMethod findSignal(QObject *, const QString &); int propertyType() const; - QDeclarativeMetaProperty::PropertyTypeCategory propertyTypeCategory() const; + QDeclarativeProperty::PropertyTypeCategory propertyTypeCategory() const; QVariant readValueProperty(); bool writeValueProperty(const QVariant &, WriteFlags); @@ -115,26 +115,26 @@ public: static QByteArray saveValueType(const QMetaObject *, int, const QMetaObject *, int); static QByteArray saveProperty(const QMetaObject *, int); - static QDeclarativeMetaProperty restore(const QByteArray &, QObject *, QDeclarativeContext *); + static QDeclarativeProperty restore(const QByteArray &, QObject *, QDeclarativeContext *); static bool equal(const QMetaObject *, const QMetaObject *); static bool canConvert(const QMetaObject *from, const QMetaObject *to); // "Public" (to QML) methods - static QDeclarativeAbstractBinding *binding(const QDeclarativeMetaProperty &that); - static QDeclarativeAbstractBinding *setBinding(const QDeclarativeMetaProperty &that, + static QDeclarativeAbstractBinding *binding(const QDeclarativeProperty &that); + static QDeclarativeAbstractBinding *setBinding(const QDeclarativeProperty &that, QDeclarativeAbstractBinding *, WriteFlags flags = DontRemoveBinding); - static QDeclarativeExpression *signalExpression(const QDeclarativeMetaProperty &that); - static QDeclarativeExpression *setSignalExpression(const QDeclarativeMetaProperty &that, + static QDeclarativeExpression *signalExpression(const QDeclarativeProperty &that); + static QDeclarativeExpression *setSignalExpression(const QDeclarativeProperty &that, QDeclarativeExpression *) ; - static bool write(const QDeclarativeMetaProperty &that, const QVariant &, WriteFlags); - static int valueTypeCoreIndex(const QDeclarativeMetaProperty &that); + static bool write(const QDeclarativeProperty &that, const QVariant &, WriteFlags); + static int valueTypeCoreIndex(const QDeclarativeProperty &that); }; -Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativeMetaPropertyPrivate::WriteFlags) +Q_DECLARE_OPERATORS_FOR_FLAGS(QDeclarativePropertyPrivate::WriteFlags) QT_END_NAMESPACE -#endif // QDECLARATIVEMETAPROPERTY_P_H +#endif // QDECLARATIVEPROPERTY_P_H diff --git a/src/declarative/qml/qdeclarativepropertyvalueinterceptor.cpp b/src/declarative/qml/qdeclarativepropertyvalueinterceptor.cpp index 7626d56..3f6d805 100644 --- a/src/declarative/qml/qdeclarativepropertyvalueinterceptor.cpp +++ b/src/declarative/qml/qdeclarativepropertyvalueinterceptor.cpp @@ -66,7 +66,7 @@ QDeclarativePropertyValueInterceptor::~QDeclarativePropertyValueInterceptor() } /*! - \fn void QDeclarativePropertyValueInterceptor::setTarget(const QDeclarativeMetaProperty &property) + \fn void QDeclarativePropertyValueInterceptor::setTarget(const QDeclarativeProperty &property) Set the target \a property for the value interceptor. This method will be called by the QML engine when assigning a value interceptor. */ diff --git a/src/declarative/qml/qdeclarativepropertyvalueinterceptor.h b/src/declarative/qml/qdeclarativepropertyvalueinterceptor.h index 2a29d5b..3de5abc 100644 --- a/src/declarative/qml/qdeclarativepropertyvalueinterceptor.h +++ b/src/declarative/qml/qdeclarativepropertyvalueinterceptor.h @@ -50,13 +50,13 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -class QDeclarativeMetaProperty; +class QDeclarativeProperty; class Q_DECLARATIVE_EXPORT QDeclarativePropertyValueInterceptor { public: QDeclarativePropertyValueInterceptor(); virtual ~QDeclarativePropertyValueInterceptor(); - virtual void setTarget(const QDeclarativeMetaProperty &property) = 0; + virtual void setTarget(const QDeclarativeProperty &property) = 0; virtual void write(const QVariant &value) = 0; }; Q_DECLARE_INTERFACE(QDeclarativePropertyValueInterceptor, "com.trolltech.qml.QDeclarativePropertyValueInterceptor") diff --git a/src/declarative/qml/qdeclarativepropertyvaluesource.cpp b/src/declarative/qml/qdeclarativepropertyvaluesource.cpp index 626e391..b106d4f 100644 --- a/src/declarative/qml/qdeclarativepropertyvaluesource.cpp +++ b/src/declarative/qml/qdeclarativepropertyvaluesource.cpp @@ -63,7 +63,7 @@ QDeclarativePropertyValueSource::~QDeclarativePropertyValueSource() } /*! - \fn void QDeclarativePropertyValueSource::setTarget(const QDeclarativeMetaProperty &property) + \fn void QDeclarativePropertyValueSource::setTarget(const QDeclarativeProperty &property) Set the target \a property for the value source. This method will be called by the QML engine when assigning a value source. */ diff --git a/src/declarative/qml/qdeclarativepropertyvaluesource.h b/src/declarative/qml/qdeclarativepropertyvaluesource.h index 99c80af..70d2c03 100644 --- a/src/declarative/qml/qdeclarativepropertyvaluesource.h +++ b/src/declarative/qml/qdeclarativepropertyvaluesource.h @@ -50,13 +50,13 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -class QDeclarativeMetaProperty; +class QDeclarativeProperty; class Q_DECLARATIVE_EXPORT QDeclarativePropertyValueSource { public: QDeclarativePropertyValueSource(); virtual ~QDeclarativePropertyValueSource(); - virtual void setTarget(const QDeclarativeMetaProperty &) = 0; + virtual void setTarget(const QDeclarativeProperty &) = 0; }; Q_DECLARE_INTERFACE(QDeclarativePropertyValueSource, "com.trolltech.qml.QDeclarativePropertyValueSource") diff --git a/src/declarative/qml/qdeclarativevaluetype.cpp b/src/declarative/qml/qdeclarativevaluetype.cpp index d35371f..01fa214 100644 --- a/src/declarative/qml/qdeclarativevaluetype.cpp +++ b/src/declarative/qml/qdeclarativevaluetype.cpp @@ -100,7 +100,7 @@ void QDeclarativePointFValueType::read(QObject *obj, int idx) QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a); } -void QDeclarativePointFValueType::write(QObject *obj, int idx, QDeclarativeMetaPropertyPrivate::WriteFlags flags) +void QDeclarativePointFValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags) { int status = -1; void *a[] = { &point, 0, &status, &flags }; @@ -148,7 +148,7 @@ void QDeclarativePointValueType::read(QObject *obj, int idx) QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a); } -void QDeclarativePointValueType::write(QObject *obj, int idx, QDeclarativeMetaPropertyPrivate::WriteFlags flags) +void QDeclarativePointValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags) { int status = -1; void *a[] = { &point, 0, &status, &flags }; @@ -196,7 +196,7 @@ void QDeclarativeSizeFValueType::read(QObject *obj, int idx) QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a); } -void QDeclarativeSizeFValueType::write(QObject *obj, int idx, QDeclarativeMetaPropertyPrivate::WriteFlags flags) +void QDeclarativeSizeFValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags) { int status = -1; void *a[] = { &size, 0, &status, &flags }; @@ -244,7 +244,7 @@ void QDeclarativeSizeValueType::read(QObject *obj, int idx) QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a); } -void QDeclarativeSizeValueType::write(QObject *obj, int idx, QDeclarativeMetaPropertyPrivate::WriteFlags flags) +void QDeclarativeSizeValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags) { int status = -1; void *a[] = { &size, 0, &status, &flags }; @@ -292,7 +292,7 @@ void QDeclarativeRectFValueType::read(QObject *obj, int idx) QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a); } -void QDeclarativeRectFValueType::write(QObject *obj, int idx, QDeclarativeMetaPropertyPrivate::WriteFlags flags) +void QDeclarativeRectFValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags) { int status = -1; void *a[] = { &rect, 0, &status, &flags }; @@ -360,7 +360,7 @@ void QDeclarativeRectValueType::read(QObject *obj, int idx) QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a); } -void QDeclarativeRectValueType::write(QObject *obj, int idx, QDeclarativeMetaPropertyPrivate::WriteFlags flags) +void QDeclarativeRectValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags) { int status = -1; void *a[] = { &rect, 0, &status, &flags }; @@ -428,7 +428,7 @@ void QDeclarativeVector3DValueType::read(QObject *obj, int idx) QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a); } -void QDeclarativeVector3DValueType::write(QObject *obj, int idx, QDeclarativeMetaPropertyPrivate::WriteFlags flags) +void QDeclarativeVector3DValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags) { int status = -1; void *a[] = { &vector, 0, &status, &flags }; @@ -486,7 +486,7 @@ void QDeclarativeEasingValueType::read(QObject *obj, int idx) QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a); } -void QDeclarativeEasingValueType::write(QObject *obj, int idx, QDeclarativeMetaPropertyPrivate::WriteFlags flags) +void QDeclarativeEasingValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags) { int status = -1; void *a[] = { &easing, 0, &status, &flags }; @@ -554,7 +554,7 @@ void QDeclarativeFontValueType::read(QObject *obj, int idx) QMetaObject::metacall(obj, QMetaObject::ReadProperty, idx, a); } -void QDeclarativeFontValueType::write(QObject *obj, int idx, QDeclarativeMetaPropertyPrivate::WriteFlags flags) +void QDeclarativeFontValueType::write(QObject *obj, int idx, QDeclarativePropertyPrivate::WriteFlags flags) { int status = -1; void *a[] = { &font, 0, &status, &flags }; diff --git a/src/declarative/qml/qdeclarativevaluetype_p.h b/src/declarative/qml/qdeclarativevaluetype_p.h index 792598b..cb153be 100644 --- a/src/declarative/qml/qdeclarativevaluetype_p.h +++ b/src/declarative/qml/qdeclarativevaluetype_p.h @@ -53,8 +53,8 @@ // We mean it. // -#include "qdeclarativemetaproperty.h" -#include "qdeclarativemetaproperty_p.h" +#include "qdeclarativeproperty.h" +#include "qdeclarativeproperty_p.h" #include <QtCore/qobject.h> #include <QtCore/qrect.h> @@ -71,7 +71,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeValueType : public QObject public: QDeclarativeValueType(QObject *parent = 0); virtual void read(QObject *, int) = 0; - virtual void write(QObject *, int, QDeclarativeMetaPropertyPrivate::WriteFlags flags) = 0; + virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags flags) = 0; virtual QVariant value() = 0; virtual void setValue(QVariant) = 0; }; @@ -96,7 +96,7 @@ public: QDeclarativePointFValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativeMetaPropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(QVariant value); @@ -118,7 +118,7 @@ public: QDeclarativePointValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativeMetaPropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(QVariant value); @@ -140,7 +140,7 @@ public: QDeclarativeSizeFValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativeMetaPropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(QVariant value); @@ -162,7 +162,7 @@ public: QDeclarativeSizeValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativeMetaPropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(QVariant value); @@ -186,7 +186,7 @@ public: QDeclarativeRectFValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativeMetaPropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(QVariant value); @@ -215,7 +215,7 @@ public: QDeclarativeRectValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativeMetaPropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(QVariant value); @@ -243,7 +243,7 @@ public: QDeclarativeVector3DValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativeMetaPropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(QVariant value); @@ -297,7 +297,7 @@ public: QDeclarativeEasingValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativeMetaPropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(QVariant value); @@ -348,7 +348,7 @@ public: QDeclarativeFontValueType(QObject *parent = 0); virtual void read(QObject *, int); - virtual void write(QObject *, int, QDeclarativeMetaPropertyPrivate::WriteFlags); + virtual void write(QObject *, int, QDeclarativePropertyPrivate::WriteFlags); virtual QVariant value(); virtual void setValue(QVariant value); diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp index f7af843..baa98bd 100644 --- a/src/declarative/qml/qdeclarativevme.cpp +++ b/src/declarative/qml/qdeclarativevme.cpp @@ -156,7 +156,7 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, QDeclarati QDeclarativeContextPrivate *cp = (QDeclarativeContextPrivate *)QObjectPrivate::get(ctxt); int status = -1; //for dbus - QDeclarativeMetaPropertyPrivate::WriteFlags flags = QDeclarativeMetaPropertyPrivate::BypassInterceptor; + QDeclarativePropertyPrivate::WriteFlags flags = QDeclarativePropertyPrivate::BypassInterceptor; for (int ii = start; !isError() && ii < (start + count); ++ii) { const QDeclarativeInstruction &instr = comp->bytecode.at(ii); @@ -515,8 +515,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, QDeclarati int sigIdx = instr.assignSignalObject.signal; const QByteArray &pr = datas.at(sigIdx); - QDeclarativeMetaProperty prop(target, QString::fromUtf8(pr)); - if (prop.type() & QDeclarativeMetaProperty::SignalProperty) { + QDeclarativeProperty prop(target, QString::fromUtf8(pr)); + if (prop.type() & QDeclarativeProperty::SignalProperty) { QMetaMethod method = QDeclarativeMetaType::defaultMethod(assign); if (method.signature() == 0) @@ -590,8 +590,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, QDeclarati QObject *context = stack.at(stack.count() - 1 - instr.assignBinding.context); - QDeclarativeMetaProperty mp = - QDeclarativeMetaPropertyPrivate::restore(datas.at(instr.assignBinding.property), target, ctxt); + QDeclarativeProperty mp = + QDeclarativePropertyPrivate::restore(datas.at(instr.assignBinding.property), target, ctxt); int coreIndex = mp.coreIndex(); @@ -631,8 +631,8 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, QDeclarati QDeclarativePropertyValueSource *vs = reinterpret_cast<QDeclarativePropertyValueSource *>(reinterpret_cast<char *>(obj) + instr.assignValueSource.castValue); QObject *target = stack.at(stack.count() - 1 - instr.assignValueSource.owner); - QDeclarativeMetaProperty prop = - QDeclarativeMetaPropertyPrivate::restore(datas.at(instr.assignValueSource.property), target, ctxt); + QDeclarativeProperty prop = + QDeclarativePropertyPrivate::restore(datas.at(instr.assignValueSource.property), target, ctxt); obj->setParent(target); vs->setTarget(prop); } @@ -643,12 +643,12 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, QDeclarati QObject *obj = stack.pop(); QDeclarativePropertyValueInterceptor *vi = reinterpret_cast<QDeclarativePropertyValueInterceptor *>(reinterpret_cast<char *>(obj) + instr.assignValueInterceptor.castValue); QObject *target = stack.at(stack.count() - 1 - instr.assignValueInterceptor.owner); - QDeclarativeMetaProperty prop = - QDeclarativeMetaPropertyPrivate::restore(datas.at(instr.assignValueInterceptor.property), target, ctxt); + QDeclarativeProperty prop = + QDeclarativePropertyPrivate::restore(datas.at(instr.assignValueInterceptor.property), target, ctxt); obj->setParent(target); vi->setTarget(prop); QDeclarativeVMEMetaObject *mo = static_cast<QDeclarativeVMEMetaObject *>((QMetaObject*)target->metaObject()); - mo->registerInterceptor(prop.coreIndex(), QDeclarativeMetaPropertyPrivate::valueTypeCoreIndex(prop), vi); + mo->registerInterceptor(prop.coreIndex(), QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), vi); } break; @@ -807,7 +807,7 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack, QDeclarati static_cast<QDeclarativeValueType *>(stack.pop()); QObject *target = stack.top(); valueHandler->write(target, instr.fetchValue.property, - QDeclarativeMetaPropertyPrivate::BypassInterceptor); + QDeclarativePropertyPrivate::BypassInterceptor); } break; diff --git a/src/declarative/qml/qdeclarativevmemetaobject.cpp b/src/declarative/qml/qdeclarativevmemetaobject.cpp index 6edb707..d67c834 100644 --- a/src/declarative/qml/qdeclarativevmemetaobject.cpp +++ b/src/declarative/qml/qdeclarativevmemetaobject.cpp @@ -105,7 +105,7 @@ int QDeclarativeVMEMetaObject::metaCall(QMetaObject::Call c, int _id, void **a) int id = _id; if(c == QMetaObject::WriteProperty) { int flags = *reinterpret_cast<int*>(a[3]); - if (!(flags & QDeclarativeMetaPropertyPrivate::BypassInterceptor) + if (!(flags & QDeclarativePropertyPrivate::BypassInterceptor) && !aInterceptors.isEmpty() && aInterceptors.testBit(id)) { QPair<int, QDeclarativePropertyValueInterceptor*> pair = interceptors.value(id); diff --git a/src/declarative/qml/qml.pri b/src/declarative/qml/qml.pri index 8a43cec..aa1a34b 100644 --- a/src/declarative/qml/qml.pri +++ b/src/declarative/qml/qml.pri @@ -6,7 +6,7 @@ SOURCES += \ $$PWD/qdeclarativeengine.cpp \ $$PWD/qdeclarativeexpression.cpp \ $$PWD/qdeclarativebinding.cpp \ - $$PWD/qdeclarativemetaproperty.cpp \ + $$PWD/qdeclarativeproperty.cpp \ $$PWD/qdeclarativecomponent.cpp \ $$PWD/qdeclarativecontext.cpp \ $$PWD/qdeclarativecustomparser.cpp \ @@ -62,7 +62,7 @@ HEADERS += \ $$PWD/qdeclarative.h \ $$PWD/qdeclarativebinding_p.h \ $$PWD/qdeclarativebinding_p_p.h \ - $$PWD/qdeclarativemetaproperty.h \ + $$PWD/qdeclarativeproperty.h \ $$PWD/qdeclarativecomponent.h \ $$PWD/qdeclarativecomponent_p.h \ $$PWD/qdeclarativecustomparser_p.h \ @@ -87,7 +87,7 @@ HEADERS += \ $$PWD/qdeclarativestringconverters_p.h \ $$PWD/qdeclarativeclassfactory_p.h \ $$PWD/qdeclarativeinfo.h \ - $$PWD/qdeclarativemetaproperty_p.h \ + $$PWD/qdeclarativeproperty_p.h \ $$PWD/qdeclarativecontext_p.h \ $$PWD/qdeclarativecompositetypedata_p.h \ $$PWD/qdeclarativecompositetypemanager_p.h \ diff --git a/src/declarative/util/qdeclarativeanimation.cpp b/src/declarative/util/qdeclarativeanimation.cpp index a327ccb..264b88c 100644 --- a/src/declarative/util/qdeclarativeanimation.cpp +++ b/src/declarative/util/qdeclarativeanimation.cpp @@ -52,7 +52,7 @@ #include <qdeclarativestringconverters_p.h> #include <qdeclarativeglobal_p.h> #include <qdeclarativemetatype_p.h> -#include <qdeclarativemetaproperty_p.h> +#include <qdeclarativeproperty_p.h> #include <qvariant.h> #include <qcolor.h> @@ -145,7 +145,7 @@ void QDeclarativeAbstractAnimationPrivate::commence() Q_Q(QDeclarativeAbstractAnimation); QDeclarativeStateActions actions; - QDeclarativeMetaProperties properties; + QDeclarativeProperties properties; q->transition(actions, properties, QDeclarativeAbstractAnimation::Forward); q->qtAnimation()->start(); @@ -155,15 +155,15 @@ void QDeclarativeAbstractAnimationPrivate::commence() } } -QDeclarativeMetaProperty QDeclarativeAbstractAnimationPrivate::createProperty(QObject *obj, const QString &str, QObject *infoObj) +QDeclarativeProperty QDeclarativeAbstractAnimationPrivate::createProperty(QObject *obj, const QString &str, QObject *infoObj) { - QDeclarativeMetaProperty prop(obj, str, qmlContext(infoObj)); + QDeclarativeProperty prop(obj, str, qmlContext(infoObj)); if (!prop.isValid()) { qmlInfo(infoObj) << QDeclarativeAbstractAnimation::tr("Cannot animate non-existent property \"%1\"").arg(str); - return QDeclarativeMetaProperty(); + return QDeclarativeProperty(); } else if (!prop.isWritable()) { qmlInfo(infoObj) << QDeclarativeAbstractAnimation::tr("Cannot animate read-only property \"%1\"").arg(str); - return QDeclarativeMetaProperty(); + return QDeclarativeProperty(); } return prop; } @@ -466,7 +466,7 @@ void QDeclarativeAbstractAnimation::complete() } } -void QDeclarativeAbstractAnimation::setTarget(const QDeclarativeMetaProperty &p) +void QDeclarativeAbstractAnimation::setTarget(const QDeclarativeProperty &p) { Q_D(QDeclarativeAbstractAnimation); d->defaultProperty = p; @@ -480,7 +480,7 @@ void QDeclarativeAbstractAnimation::setTarget(const QDeclarativeMetaProperty &p) so this function allows us to do the same thing as setTarget without that assumption */ -void QDeclarativeAbstractAnimation::setDefaultTarget(const QDeclarativeMetaProperty &p) +void QDeclarativeAbstractAnimation::setDefaultTarget(const QDeclarativeProperty &p) { Q_D(QDeclarativeAbstractAnimation); d->defaultProperty = p; @@ -498,7 +498,7 @@ void QDeclarativeAbstractAnimation::setDisableUserControl() } void QDeclarativeAbstractAnimation::transition(QDeclarativeStateActions &actions, - QDeclarativeMetaProperties &modified, + QDeclarativeProperties &modified, TransitionDirection direction) { Q_UNUSED(actions); @@ -729,7 +729,7 @@ void QDeclarativeScriptActionPrivate::execute() } void QDeclarativeScriptAction::transition(QDeclarativeStateActions &actions, - QDeclarativeMetaProperties &modified, + QDeclarativeProperties &modified, TransitionDirection direction) { Q_D(QDeclarativeScriptAction); @@ -912,7 +912,7 @@ QAbstractAnimation *QDeclarativePropertyAction::qtAnimation() } void QDeclarativePropertyAction::transition(QDeclarativeStateActions &actions, - QDeclarativeMetaProperties &modified, + QDeclarativeProperties &modified, TransitionDirection direction) { Q_D(QDeclarativePropertyAction); @@ -925,7 +925,7 @@ void QDeclarativePropertyAction::transition(QDeclarativeStateActions &actions, { for (int ii = 0; ii < actions.count(); ++ii) { const QDeclarativeAction &action = actions.at(ii); - QDeclarativeMetaPropertyPrivate::write(action.property, action.toValue, QDeclarativeMetaPropertyPrivate::BypassInterceptor | QDeclarativeMetaPropertyPrivate::DontRemoveBinding); + QDeclarativePropertyPrivate::write(action.property, action.toValue, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); } } }; @@ -1133,7 +1133,7 @@ QAbstractAnimation *QDeclarativeParentAction::qtAnimation() } void QDeclarativeParentAction::transition(QDeclarativeStateActions &actions, - QDeclarativeMetaProperties &modified, + QDeclarativeProperties &modified, TransitionDirection direction) { Q_D(QDeclarativeParentAction); @@ -1582,7 +1582,7 @@ QAbstractAnimation *QDeclarativeSequentialAnimation::qtAnimation() } void QDeclarativeSequentialAnimation::transition(QDeclarativeStateActions &actions, - QDeclarativeMetaProperties &modified, + QDeclarativeProperties &modified, TransitionDirection direction) { Q_D(QDeclarativeAnimationGroup); @@ -1647,7 +1647,7 @@ QAbstractAnimation *QDeclarativeParallelAnimation::qtAnimation() } void QDeclarativeParallelAnimation::transition(QDeclarativeStateActions &actions, - QDeclarativeMetaProperties &modified, + QDeclarativeProperties &modified, TransitionDirection direction) { Q_D(QDeclarativeAnimationGroup); @@ -2231,7 +2231,7 @@ struct PropertyUpdater : public QDeclarativeTimeLineValue QDeclarativeAction &action = actions[ii]; if (v == 1.) - QDeclarativeMetaPropertyPrivate::write(action.property, action.toValue, QDeclarativeMetaPropertyPrivate::BypassInterceptor | QDeclarativeMetaPropertyPrivate::DontRemoveBinding); + QDeclarativePropertyPrivate::write(action.property, action.toValue, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); else { if (!fromSourced && !fromDefined) { action.fromValue = action.property.read(); @@ -2246,7 +2246,7 @@ struct PropertyUpdater : public QDeclarativeTimeLineValue } } if (interpolator) - QDeclarativeMetaPropertyPrivate::write(action.property, interpolator(action.fromValue.constData(), action.toValue.constData(), v), QDeclarativeMetaPropertyPrivate::BypassInterceptor | QDeclarativeMetaPropertyPrivate::DontRemoveBinding); + QDeclarativePropertyPrivate::write(action.property, interpolator(action.fromValue.constData(), action.toValue.constData(), v), QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); } if (deleted) return; @@ -2257,7 +2257,7 @@ struct PropertyUpdater : public QDeclarativeTimeLineValue }; void QDeclarativePropertyAnimation::transition(QDeclarativeStateActions &actions, - QDeclarativeMetaProperties &modified, + QDeclarativeProperties &modified, TransitionDirection direction) { Q_D(QDeclarativePropertyAnimation); diff --git a/src/declarative/util/qdeclarativeanimation_p.h b/src/declarative/util/qdeclarativeanimation_p.h index 02dacb3..53afbb5 100644 --- a/src/declarative/util/qdeclarativeanimation_p.h +++ b/src/declarative/util/qdeclarativeanimation_p.h @@ -95,7 +95,7 @@ public: QDeclarativeAnimationGroup *group() const; void setGroup(QDeclarativeAnimationGroup *); - void setDefaultTarget(const QDeclarativeMetaProperty &); + void setDefaultTarget(const QDeclarativeProperty &); void setDisableUserControl(); void classBegin(); @@ -123,7 +123,7 @@ protected: public: enum TransitionDirection { Forward, Backward }; virtual void transition(QDeclarativeStateActions &actions, - QDeclarativeMetaProperties &modified, + QDeclarativeProperties &modified, TransitionDirection direction); virtual QAbstractAnimation *qtAnimation() = 0; @@ -131,7 +131,7 @@ private Q_SLOTS: void timelineComplete(); private: - virtual void setTarget(const QDeclarativeMetaProperty &); + virtual void setTarget(const QDeclarativeProperty &); }; class QDeclarativePauseAnimationPrivate; @@ -177,7 +177,7 @@ public: protected: virtual void transition(QDeclarativeStateActions &actions, - QDeclarativeMetaProperties &modified, + QDeclarativeProperties &modified, TransitionDirection direction); virtual QAbstractAnimation *qtAnimation(); }; @@ -221,7 +221,7 @@ Q_SIGNALS: protected: virtual void transition(QDeclarativeStateActions &actions, - QDeclarativeMetaProperties &modified, + QDeclarativeProperties &modified, TransitionDirection direction); virtual QAbstractAnimation *qtAnimation(); }; @@ -248,7 +248,7 @@ public: protected: virtual void transition(QDeclarativeStateActions &actions, - QDeclarativeMetaProperties &modified, + QDeclarativeProperties &modified, TransitionDirection direction); virtual QAbstractAnimation *qtAnimation(); }; @@ -300,7 +300,7 @@ public: protected: QDeclarativePropertyAnimation(QDeclarativePropertyAnimationPrivate &dd, QObject *parent); virtual void transition(QDeclarativeStateActions &actions, - QDeclarativeMetaProperties &modified, + QDeclarativeProperties &modified, TransitionDirection direction); virtual QAbstractAnimation *qtAnimation(); @@ -426,7 +426,7 @@ public: protected: virtual void transition(QDeclarativeStateActions &actions, - QDeclarativeMetaProperties &modified, + QDeclarativeProperties &modified, TransitionDirection direction); virtual QAbstractAnimation *qtAnimation(); }; @@ -442,7 +442,7 @@ public: protected: virtual void transition(QDeclarativeStateActions &actions, - QDeclarativeMetaProperties &modified, + QDeclarativeProperties &modified, TransitionDirection direction); virtual QAbstractAnimation *qtAnimation(); }; diff --git a/src/declarative/util/qdeclarativeanimation_p_p.h b/src/declarative/util/qdeclarativeanimation_p_p.h index 65c9807..fc4e6e6 100644 --- a/src/declarative/util/qdeclarativeanimation_p_p.h +++ b/src/declarative/util/qdeclarativeanimation_p_p.h @@ -226,11 +226,11 @@ public: void commence(); - QDeclarativeMetaProperty defaultProperty; + QDeclarativeProperty defaultProperty; QDeclarativeAnimationGroup *group; - static QDeclarativeMetaProperty createProperty(QObject *obj, const QString &str, QObject *infoObj); + static QDeclarativeProperty createProperty(QObject *obj, const QString &str, QObject *infoObj); }; class QDeclarativePauseAnimationPrivate : public QDeclarativeAbstractAnimationPrivate diff --git a/src/declarative/util/qdeclarativebehavior.cpp b/src/declarative/util/qdeclarativebehavior.cpp index b1f1677..e0189dc 100644 --- a/src/declarative/util/qdeclarativebehavior.cpp +++ b/src/declarative/util/qdeclarativebehavior.cpp @@ -46,7 +46,7 @@ #include <qdeclarativecontext.h> #include <qdeclarativeinfo.h> -#include <qdeclarativemetaproperty_p.h> +#include <qdeclarativeproperty_p.h> #include <QtCore/qparallelanimationgroup.h> @@ -62,7 +62,7 @@ class QDeclarativeBehaviorPrivate : public QObjectPrivate public: QDeclarativeBehaviorPrivate() : animation(0), enabled(true) {} - QDeclarativeMetaProperty property; + QDeclarativeProperty property; QVariant currentValue; QDeclarativeAbstractAnimation *animation; bool enabled; @@ -157,7 +157,7 @@ void QDeclarativeBehavior::write(const QVariant &value) { Q_D(QDeclarativeBehavior); if (!d->animation || !d->enabled) { - QDeclarativeMetaPropertyPrivate::write(d->property, value, QDeclarativeMetaPropertyPrivate::BypassInterceptor | QDeclarativeMetaPropertyPrivate::DontRemoveBinding); + QDeclarativePropertyPrivate::write(d->property, value, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); return; } @@ -172,15 +172,15 @@ void QDeclarativeBehavior::write(const QVariant &value) action.toValue = value; actions << action; - QList<QDeclarativeMetaProperty> after; + QList<QDeclarativeProperty> after; if (d->animation) d->animation->transition(actions, after, QDeclarativeAbstractAnimation::Forward); d->animation->qtAnimation()->start(); if (!after.contains(d->property)) - QDeclarativeMetaPropertyPrivate::write(d->property, value, QDeclarativeMetaPropertyPrivate::BypassInterceptor | QDeclarativeMetaPropertyPrivate::DontRemoveBinding); + QDeclarativePropertyPrivate::write(d->property, value, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); } -void QDeclarativeBehavior::setTarget(const QDeclarativeMetaProperty &property) +void QDeclarativeBehavior::setTarget(const QDeclarativeProperty &property) { Q_D(QDeclarativeBehavior); d->property = property; diff --git a/src/declarative/util/qdeclarativebehavior_p.h b/src/declarative/util/qdeclarativebehavior_p.h index fbc19f8..a633b55 100644 --- a/src/declarative/util/qdeclarativebehavior_p.h +++ b/src/declarative/util/qdeclarativebehavior_p.h @@ -70,7 +70,7 @@ public: QDeclarativeBehavior(QObject *parent=0); ~QDeclarativeBehavior(); - virtual void setTarget(const QDeclarativeMetaProperty &); + virtual void setTarget(const QDeclarativeProperty &); virtual void write(const QVariant &value); QDeclarativeAbstractAnimation *animation(); diff --git a/src/declarative/util/qdeclarativebind.cpp b/src/declarative/util/qdeclarativebind.cpp index d75e98d..e95a03e 100644 --- a/src/declarative/util/qdeclarativebind.cpp +++ b/src/declarative/util/qdeclarativebind.cpp @@ -45,7 +45,7 @@ #include <qdeclarativeengine.h> #include <qdeclarativecontext.h> -#include <qdeclarativemetaproperty.h> +#include <qdeclarativeproperty.h> #include <QtCore/qfile.h> #include <QtCore/qdebug.h> @@ -196,7 +196,7 @@ void QDeclarativeBind::eval() if (!d->obj || d->value.isNull || !d->when || !d->componentComplete) return; - QDeclarativeMetaProperty prop(d->obj, d->prop); + QDeclarativeProperty prop(d->obj, d->prop); prop.write(d->value.value); } diff --git a/src/declarative/util/qdeclarativeeasefollow.cpp b/src/declarative/util/qdeclarativeeasefollow.cpp index 0430a0b..232dc90 100644 --- a/src/declarative/util/qdeclarativeeasefollow.cpp +++ b/src/declarative/util/qdeclarativeeasefollow.cpp @@ -43,7 +43,7 @@ #include "qdeclarativeanimation_p_p.h" -#include <qdeclarativemetaproperty.h> +#include <qdeclarativeproperty.h> #include <QtCore/qdebug.h> @@ -77,7 +77,7 @@ public: qreal trackVelocity; - QDeclarativeMetaProperty target; + QDeclarativeProperty target; int clockOffset; int lastTick; @@ -500,7 +500,7 @@ void QDeclarativeEaseFollow::setEnabled(bool enabled) emit enabledChanged(); } -void QDeclarativeEaseFollow::setTarget(const QDeclarativeMetaProperty &t) +void QDeclarativeEaseFollow::setTarget(const QDeclarativeProperty &t) { Q_D(QDeclarativeEaseFollow); d->target = t; diff --git a/src/declarative/util/qdeclarativeeasefollow_p.h b/src/declarative/util/qdeclarativeeasefollow_p.h index 6d14eb5..83d1eff 100644 --- a/src/declarative/util/qdeclarativeeasefollow_p.h +++ b/src/declarative/util/qdeclarativeeasefollow_p.h @@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -class QDeclarativeMetaProperty; +class QDeclarativeProperty; class QDeclarativeEaseFollowPrivate; class Q_DECLARATIVE_EXPORT QDeclarativeEaseFollow : public QObject, public QDeclarativePropertyValueSource @@ -94,7 +94,7 @@ public: qreal maximumEasingTime() const; void setMaximumEasingTime(qreal); - virtual void setTarget(const QDeclarativeMetaProperty &); + virtual void setTarget(const QDeclarativeProperty &); Q_SIGNALS: void sourceChanged(); diff --git a/src/declarative/util/qdeclarativepropertychanges.cpp b/src/declarative/util/qdeclarativepropertychanges.cpp index 454fb06..9c2b1e6 100644 --- a/src/declarative/util/qdeclarativepropertychanges.cpp +++ b/src/declarative/util/qdeclarativepropertychanges.cpp @@ -50,7 +50,7 @@ #include <qdeclarativebinding_p.h> #include <qdeclarativecontext.h> #include <qdeclarativeguard_p.h> -#include <qdeclarativemetaproperty_p.h> +#include <qdeclarativeproperty_p.h> #include <QtCore/qdebug.h> @@ -153,19 +153,19 @@ public: virtual QString typeName() const { return QLatin1String("ReplaceSignalHandler"); } - QDeclarativeMetaProperty property; + QDeclarativeProperty property; QDeclarativeExpression *expression; QDeclarativeExpression *reverseExpression; QDeclarativeExpression *rewindExpression; QDeclarativeGuard<QDeclarativeExpression> ownedExpression; virtual void execute() { - ownedExpression = QDeclarativeMetaPropertyPrivate::setSignalExpression(property, expression); + ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, expression); } virtual bool isReversable() { return true; } virtual void reverse() { - ownedExpression = QDeclarativeMetaPropertyPrivate::setSignalExpression(property, reverseExpression); + ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, reverseExpression); } virtual void saveOriginals() { @@ -174,10 +174,10 @@ public: } virtual void rewind() { - ownedExpression = QDeclarativeMetaPropertyPrivate::setSignalExpression(property, rewindExpression); + ownedExpression = QDeclarativePropertyPrivate::setSignalExpression(property, rewindExpression); } virtual void saveCurrentValues() { - rewindExpression = QDeclarativeMetaPropertyPrivate::signalExpression(property); + rewindExpression = QDeclarativePropertyPrivate::signalExpression(property); } virtual bool override(QDeclarativeActionEvent*other) { @@ -212,7 +212,7 @@ public: QList<QPair<QByteArray, QDeclarativeExpression *> > expressions; QList<QDeclarativeReplaceSignalHandler*> signalReplacements; - QDeclarativeMetaProperty property(const QByteArray &); + QDeclarativeProperty property(const QByteArray &); }; void @@ -296,8 +296,8 @@ void QDeclarativePropertyChangesPrivate::decode() ds >> isScript; ds >> data; - QDeclarativeMetaProperty prop = property(name); //### better way to check for signal property? - if (prop.type() & QDeclarativeMetaProperty::SignalProperty) { + QDeclarativeProperty prop = property(name); //### better way to check for signal property? + if (prop.type() & QDeclarativeProperty::SignalProperty) { QDeclarativeExpression *expression = new QDeclarativeExpression(qmlContext(q), data.toString(), object); QDeclarativeReplaceSignalHandler *handler = new QDeclarativeReplaceSignalHandler; handler->property = prop; @@ -371,17 +371,17 @@ void QDeclarativePropertyChanges::setRestoreEntryValues(bool v) d->restore = v; } -QDeclarativeMetaProperty +QDeclarativeProperty QDeclarativePropertyChangesPrivate::property(const QByteArray &property) { Q_Q(QDeclarativePropertyChanges); - QDeclarativeMetaProperty prop(object, QString::fromUtf8(property)); + QDeclarativeProperty prop(object, QString::fromUtf8(property)); if (!prop.isValid()) { qmlInfo(q) << QDeclarativePropertyChanges::tr("Cannot assign to non-existent property \"%1\"").arg(QString::fromUtf8(property)); - return QDeclarativeMetaProperty(); - } else if (!(prop.type() & QDeclarativeMetaProperty::SignalProperty) && !prop.isWritable()) { + return QDeclarativeProperty(); + } else if (!(prop.type() & QDeclarativeProperty::SignalProperty) && !prop.isWritable()) { qmlInfo(q) << QDeclarativePropertyChanges::tr("Cannot assign to read-only property \"%1\"").arg(QString::fromUtf8(property)); - return QDeclarativeMetaProperty(); + return QDeclarativeProperty(); } return prop; } @@ -426,7 +426,7 @@ QDeclarativePropertyChanges::ActionList QDeclarativePropertyChanges::actions() for (int ii = 0; ii < d->expressions.count(); ++ii) { QByteArray property = d->expressions.at(ii).first; - QDeclarativeMetaProperty prop = d->property(property); + QDeclarativeProperty prop = d->property(property); if (prop.isValid()) { QDeclarativeAction a; diff --git a/src/declarative/util/qdeclarativespringfollow.cpp b/src/declarative/util/qdeclarativespringfollow.cpp index b26a7e2..012e6a0 100644 --- a/src/declarative/util/qdeclarativespringfollow.cpp +++ b/src/declarative/util/qdeclarativespringfollow.cpp @@ -63,7 +63,7 @@ public: , mass(1.0), spring(0.), damping(0.), velocity(0), epsilon(0.01) , modulus(0.0), useMass(false), haveModulus(false), enabled(true), mode(Track), clock(this) {} - QDeclarativeMetaProperty property; + QDeclarativeProperty property; qreal currentValue; qreal sourceValue; qreal maxVelocity; @@ -254,7 +254,7 @@ QDeclarativeSpringFollow::~QDeclarativeSpringFollow() { } -void QDeclarativeSpringFollow::setTarget(const QDeclarativeMetaProperty &property) +void QDeclarativeSpringFollow::setTarget(const QDeclarativeProperty &property) { Q_D(QDeclarativeSpringFollow); d->property = property; diff --git a/src/declarative/util/qdeclarativespringfollow_p.h b/src/declarative/util/qdeclarativespringfollow_p.h index 63d38a4..2ac0d82 100644 --- a/src/declarative/util/qdeclarativespringfollow_p.h +++ b/src/declarative/util/qdeclarativespringfollow_p.h @@ -74,7 +74,7 @@ public: QDeclarativeSpringFollow(QObject *parent=0); ~QDeclarativeSpringFollow(); - virtual void setTarget(const QDeclarativeMetaProperty &); + virtual void setTarget(const QDeclarativeProperty &); qreal sourceValue() const; void setSourceValue(qreal value); diff --git a/src/declarative/util/qdeclarativestate.cpp b/src/declarative/util/qdeclarativestate.cpp index 3b06e33..1d70d33 100644 --- a/src/declarative/util/qdeclarativestate.cpp +++ b/src/declarative/util/qdeclarativestate.cpp @@ -334,7 +334,7 @@ void QDeclarativeState::cancel() void QDeclarativeAction::deleteFromBinding() { if (fromBinding) { - QDeclarativeMetaPropertyPrivate::setBinding(property, 0); + QDeclarativePropertyPrivate::setBinding(property, 0); fromBinding->destroy(); fromBinding = 0; } @@ -388,7 +388,7 @@ void QDeclarativeState::apply(QDeclarativeStateGroup *group, QDeclarativeTransit else if (action.event->isRewindable()) action.event->saveCurrentValues(); } else { - action.fromBinding = QDeclarativeMetaPropertyPrivate::binding(action.property); + action.fromBinding = QDeclarativePropertyPrivate::binding(action.property); for (jj = 0; jj < d->revertList.count(); ++jj) { if (d->revertList.at(jj).property == action.property) { @@ -437,7 +437,7 @@ void QDeclarativeState::apply(QDeclarativeStateGroup *group, QDeclarativeTransit if (!found) { QVariant cur = d->revertList.at(ii).property.read(); QDeclarativeAbstractBinding *delBinding = - QDeclarativeMetaPropertyPrivate::setBinding(d->revertList.at(ii).property, 0); + QDeclarativePropertyPrivate::setBinding(d->revertList.at(ii).property, 0); if (delBinding) delBinding->destroy(); diff --git a/src/declarative/util/qdeclarativestate_p.h b/src/declarative/util/qdeclarativestate_p.h index 4a62481..abdbec5 100644 --- a/src/declarative/util/qdeclarativestate_p.h +++ b/src/declarative/util/qdeclarativestate_p.h @@ -43,7 +43,7 @@ #define QDECLARATIVESTATE_H #include <qdeclarative.h> -#include <qdeclarativemetaproperty.h> +#include <qdeclarativeproperty.h> #include <QtCore/qobject.h> QT_BEGIN_HEADER @@ -65,7 +65,7 @@ public: bool reverseEvent:1; bool deletableToBinding:1; - QDeclarativeMetaProperty property; + QDeclarativeProperty property; QVariant fromValue; QVariant toValue; diff --git a/src/declarative/util/qdeclarativestate_p_p.h b/src/declarative/util/qdeclarativestate_p_p.h index 6b32f04..6f52219 100644 --- a/src/declarative/util/qdeclarativestate_p_p.h +++ b/src/declarative/util/qdeclarativestate_p_p.h @@ -58,7 +58,7 @@ #include "qdeclarativeanimation_p_p.h" #include "qdeclarativetransitionmanager_p_p.h" -#include <qdeclarativemetaproperty_p.h> +#include <qdeclarativeproperty_p.h> #include <qdeclarativeguard_p.h> #include <private/qobject_p.h> @@ -77,7 +77,7 @@ public: event = a.event; if (state == StartState) { value = a.fromValue; - binding = QDeclarativeMetaPropertyPrivate::binding(property); + binding = QDeclarativePropertyPrivate::binding(property); reverseEvent = true; } else { value = a.toValue; @@ -86,7 +86,7 @@ public: } } - QDeclarativeMetaProperty property; + QDeclarativeProperty property; QVariant value; QDeclarativeAbstractBinding *binding; QObject *specifiedObject; @@ -139,7 +139,7 @@ public: QDeclarativeTransitionManager transitionManager; SimpleActionList revertList; - QList<QDeclarativeMetaProperty> reverting; + QList<QDeclarativeProperty> reverting; QString extends; mutable bool inState; QDeclarativeStateGroup *group; diff --git a/src/declarative/util/qdeclarativestateoperations.cpp b/src/declarative/util/qdeclarativestateoperations.cpp index 98edf85..9df8658 100644 --- a/src/declarative/util/qdeclarativestateoperations.cpp +++ b/src/declarative/util/qdeclarativestateoperations.cpp @@ -661,19 +661,19 @@ QList<QDeclarativeAction> QDeclarativeAnchorChanges::extraActions() if (d->target) { QDeclarativeAction a; a.fromValue = d->fromX; - a.property = QDeclarativeMetaProperty(d->target, QLatin1String("x")); + a.property = QDeclarativeProperty(d->target, QLatin1String("x")); extra << a; a.fromValue = d->fromY; - a.property = QDeclarativeMetaProperty(d->target, QLatin1String("y")); + a.property = QDeclarativeProperty(d->target, QLatin1String("y")); extra << a; a.fromValue = d->fromWidth; - a.property = QDeclarativeMetaProperty(d->target, QLatin1String("width")); + a.property = QDeclarativeProperty(d->target, QLatin1String("width")); extra << a; a.fromValue = d->fromHeight; - a.property = QDeclarativeMetaProperty(d->target, QLatin1String("height")); + a.property = QDeclarativeProperty(d->target, QLatin1String("height")); extra << a; } diff --git a/src/declarative/util/qdeclarativetransition.cpp b/src/declarative/util/qdeclarativetransition.cpp index 3482814..ac07b10 100644 --- a/src/declarative/util/qdeclarativetransition.cpp +++ b/src/declarative/util/qdeclarativetransition.cpp @@ -148,7 +148,7 @@ void QDeclarativeTransition::setReversed(bool r) } void QDeclarativeTransition::prepare(QDeclarativeStateOperation::ActionList &actions, - QList<QDeclarativeMetaProperty> &after, + QList<QDeclarativeProperty> &after, QDeclarativeTransitionManager *endState) { Q_D(QDeclarativeTransition); diff --git a/src/declarative/util/qdeclarativetransition_p.h b/src/declarative/util/qdeclarativetransition_p.h index 96448b8..861111a 100644 --- a/src/declarative/util/qdeclarativetransition_p.h +++ b/src/declarative/util/qdeclarativetransition_p.h @@ -85,7 +85,7 @@ public: QDeclarativeListProperty<QDeclarativeAbstractAnimation> animations(); void prepare(QDeclarativeStateOperation::ActionList &actions, - QList<QDeclarativeMetaProperty> &after, + QList<QDeclarativeProperty> &after, QDeclarativeTransitionManager *end); void setReversed(bool r); diff --git a/src/declarative/util/qdeclarativetransitionmanager.cpp b/src/declarative/util/qdeclarativetransitionmanager.cpp index 6429dab..e1143fa 100644 --- a/src/declarative/util/qdeclarativetransitionmanager.cpp +++ b/src/declarative/util/qdeclarativetransitionmanager.cpp @@ -45,7 +45,7 @@ #include <qdeclarativebinding_p.h> #include <qdeclarativeglobal_p.h> -#include <qdeclarativemetaproperty_p.h> +#include <qdeclarativeproperty_p.h> QT_BEGIN_NAMESPACE @@ -85,7 +85,7 @@ void QDeclarativeTransitionManager::complete() d->applyBindings(); for (int ii = 0; ii < d->completeList.count(); ++ii) { - const QDeclarativeMetaProperty &prop = d->completeList.at(ii).property; + const QDeclarativeProperty &prop = d->completeList.at(ii).property; prop.write(d->completeList.at(ii).value); } @@ -99,7 +99,7 @@ void QDeclarativeTransitionManagerPrivate::applyBindings() { foreach(const QDeclarativeAction &action, bindingsList) { if (action.toBinding) { - QDeclarativeMetaPropertyPrivate::setBinding(action.property, action.toBinding); + QDeclarativePropertyPrivate::setBinding(action.property, action.toBinding); } else if (action.event) { if (action.reverseEvent) action.event->reverse(); @@ -123,7 +123,7 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> & if (action.toBinding) d->bindingsList << action; if (action.fromBinding) - QDeclarativeMetaPropertyPrivate::setBinding(action.property, 0); // Disable current binding + QDeclarativePropertyPrivate::setBinding(action.property, 0); // Disable current binding if (action.event && action.event->changesBindings()) { //### assume isReversable()? d->bindingsList << action; if (action.reverseEvent) @@ -150,9 +150,9 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> & for (int ii = 0; ii < applyList.size(); ++ii) { const QDeclarativeAction &action = applyList.at(ii); if (action.toBinding) { - QDeclarativeMetaPropertyPrivate::setBinding(action.property, action.toBinding, QDeclarativeMetaPropertyPrivate::BypassInterceptor | QDeclarativeMetaPropertyPrivate::DontRemoveBinding); + QDeclarativePropertyPrivate::setBinding(action.property, action.toBinding, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); } else if (!action.event) { - QDeclarativeMetaPropertyPrivate::write(action.property, action.toValue, QDeclarativeMetaPropertyPrivate::BypassInterceptor | QDeclarativeMetaPropertyPrivate::DontRemoveBinding); + QDeclarativePropertyPrivate::write(action.property, action.toValue, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); } else if (action.event->isReversable()) { if (action.reverseEvent) action.event->reverse(); @@ -167,7 +167,7 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> & QDeclarativeAction *action = &applyList[ii]; if (action->event) continue; - const QDeclarativeMetaProperty &prop = action->property; + const QDeclarativeProperty &prop = action->property; if (action->toBinding || !action->toValue.isValid()) { //### is this always right (used for exta actions) action->toValue = prop.read(); } @@ -191,14 +191,14 @@ void QDeclarativeTransitionManager::transition(const QList<QDeclarativeAction> & } if (action.toBinding) - QDeclarativeMetaPropertyPrivate::setBinding(action.property, 0); // Make sure this is disabled during the transition + QDeclarativePropertyPrivate::setBinding(action.property, 0); // Make sure this is disabled during the transition - QDeclarativeMetaPropertyPrivate::write(action.property, action.fromValue, QDeclarativeMetaPropertyPrivate::BypassInterceptor | QDeclarativeMetaPropertyPrivate::DontRemoveBinding); + QDeclarativePropertyPrivate::write(action.property, action.fromValue, QDeclarativePropertyPrivate::BypassInterceptor | QDeclarativePropertyPrivate::DontRemoveBinding); } } if (transition) { - QList<QDeclarativeMetaProperty> touched; + QList<QDeclarativeProperty> touched; d->transition = transition; d->transition->prepare(applyList, touched, this); @@ -267,7 +267,7 @@ void QDeclarativeTransitionManager::cancel() for(int i = 0; i < d->bindingsList.count(); ++i) { QDeclarativeAction action = d->bindingsList[i]; if (action.toBinding && action.deletableToBinding) { - QDeclarativeMetaPropertyPrivate::setBinding(action.property, 0); + QDeclarativePropertyPrivate::setBinding(action.property, 0); action.toBinding->destroy(); action.toBinding = 0; action.deletableToBinding = false; diff --git a/tests/auto/declarative/declarative.pro b/tests/auto/declarative/declarative.pro index 669213c..42ff523 100644 --- a/tests/auto/declarative/declarative.pro +++ b/tests/auto/declarative/declarative.pro @@ -41,7 +41,7 @@ SUBDIRS += \ qdeclarativelanguage \ # Cover qdeclarativelistreference \ # Cover qdeclarativelistmodel \ # Cover - qdeclarativemetaproperty \ # Cover + qdeclarativeproperty \ # Cover qdeclarativemetatype \ # Cover qdeclarativemoduleplugin \ # Cover qdeclarativenumberformatter \ # Cover diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp index 8d5a1f6..0c3ca76 100644 --- a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp +++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp @@ -49,7 +49,7 @@ #include <QtDeclarative/qdeclarativecontext.h> #include <QtDeclarative/qdeclarativecomponent.h> #include <QtDeclarative/qdeclarativeexpression.h> -#include <QtDeclarative/qdeclarativemetaproperty.h> +#include <QtDeclarative/qdeclarativeproperty.h> #include <private/qdeclarativebinding_p.h> #include <private/qdeclarativedebug_p.h> @@ -58,7 +58,7 @@ #include <private/qdeclarativedebugservice_p.h> #include <private/qdeclarativerectangle_p.h> #include <private/qdeclarativemetatype_p.h> -#include <private/qdeclarativemetaproperty_p.h> +#include <private/qdeclarativeproperty_p.h> #include "../shared/debugutil_p.h" @@ -218,7 +218,7 @@ void tst_QDeclarativeDebug::recursiveObjectTest(QObject *o, const QDeclarativeDe QCOMPARE(p.valueTypeName(), QString::fromUtf8(pmeta.typeName())); QDeclarativeAbstractBinding *binding = - QDeclarativeMetaPropertyPrivate::binding(QDeclarativeMetaProperty(o, p.name())); + QDeclarativePropertyPrivate::binding(QDeclarativeProperty(o, p.name())); if (binding) QCOMPARE(binding->expression(), p.binding()); diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.h b/tests/auto/declarative/qdeclarativelanguage/testtypes.h index fc1ede7..8ac7aa6 100644 --- a/tests/auto/declarative/qdeclarativelanguage/testtypes.h +++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.h @@ -52,7 +52,7 @@ #include <QtDeclarative/qdeclarativeparserstatus.h> #include <QtDeclarative/qdeclarativepropertyvaluesource.h> #include <QtDeclarative/qdeclarativescriptstring.h> -#include <QtDeclarative/qdeclarativemetaproperty.h> +#include <QtDeclarative/qdeclarativeproperty.h> QVariant myCustomVariantTypeConverter(const QString &data); @@ -480,8 +480,8 @@ public: MyPropertyValueSource() : QDeclarativePropertyValueSource() {} - QDeclarativeMetaProperty prop; - virtual void setTarget(const QDeclarativeMetaProperty &p) + QDeclarativeProperty prop; + virtual void setTarget(const QDeclarativeProperty &p) { prop = p; } diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp index 2907757..1ba4454 100644 --- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp +++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp @@ -46,7 +46,7 @@ #include <QtCore/qfileinfo.h> #include <QtCore/qdir.h> -#include <private/qdeclarativemetaproperty_p.h> +#include <private/qdeclarativeproperty_p.h> #include <private/qdeclarativemetatype_p.h> #include "testtypes.h" @@ -747,14 +747,14 @@ void tst_qdeclarativelanguage::valueTypes() // ### #if 0 - QDeclarativeMetaProperty p(object, "rectProperty.x"); + QDeclarativeProperty p(object, "rectProperty.x"); QCOMPARE(p.read(), QVariant(12)); p.write(13); QCOMPARE(p.read(), QVariant(13)); - quint32 r = QDeclarativeMetaPropertyPrivate::saveValueType(p.coreIndex(), p.valueTypeCoreIndex()); - QDeclarativeMetaProperty p2; - QDeclarativeMetaPropertyPrivate::restore(p2, r, object); + quint32 r = QDeclarativePropertyPrivate::saveValueType(p.coreIndex(), p.valueTypeCoreIndex()); + QDeclarativeProperty p2; + QDeclarativePropertyPrivate::restore(p2, r, object); QCOMPARE(p2.read(), QVariant(13)); #endif } diff --git a/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp b/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp index fdcb98a..1b7af19 100644 --- a/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp +++ b/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp @@ -47,7 +47,7 @@ #include <QDeclarativeComponent> #include <QtDeclarative/qdeclarative.h> #include <QtDeclarative/qdeclarativeprivate.h> -#include <QtDeclarative/qdeclarativemetaproperty.h> +#include <QtDeclarative/qdeclarativeproperty.h> #include <QDebug> inline QUrl TEST_FILE(const QString &filename) @@ -530,7 +530,7 @@ void tst_qdeclarativelistreference::qmlmetaproperty() tt.data.append(0); tt.data.append(&tt); - QDeclarativeMetaProperty prop(&tt, QLatin1String("data")); + QDeclarativeProperty prop(&tt, QLatin1String("data")); QVariant v = prop.read(); QVERIFY(v.userType() == qMetaTypeId<QDeclarativeListReference>()); QDeclarativeListReference ref = qvariant_cast<QDeclarativeListReference>(v); @@ -546,11 +546,11 @@ void tst_qdeclarativelistreference::engineTypes() QObject *o = component.create(); QVERIFY(o); - QDeclarativeMetaProperty p1(o, QLatin1String("myList")); - QVERIFY(p1.propertyTypeCategory() == QDeclarativeMetaProperty::Normal); + QDeclarativeProperty p1(o, QLatin1String("myList")); + QVERIFY(p1.propertyTypeCategory() == QDeclarativeProperty::Normal); - QDeclarativeMetaProperty p2(o, QLatin1String("myList"), engine.rootContext()); - QVERIFY(p2.propertyTypeCategory() == QDeclarativeMetaProperty::List); + QDeclarativeProperty p2(o, QLatin1String("myList"), engine.rootContext()); + QVERIFY(p2.propertyTypeCategory() == QDeclarativeProperty::List); QVariant v = p2.read(); QVERIFY(v.userType() == qMetaTypeId<QDeclarativeListReference>()); QDeclarativeListReference ref = qvariant_cast<QDeclarativeListReference>(v); diff --git a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp index 4333e02..818f108 100644 --- a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp +++ b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp @@ -97,7 +97,7 @@ class ValueSourceTestType : public QObject, public QDeclarativePropertyValueSour Q_OBJECT Q_INTERFACES(QDeclarativePropertyValueSource) public: - virtual void setTarget(const QDeclarativeMetaProperty &) {} + virtual void setTarget(const QDeclarativeProperty &) {} }; QML_DECLARE_TYPE(ValueSourceTestType); @@ -106,7 +106,7 @@ class ValueInterceptorTestType : public QObject, public QDeclarativePropertyValu Q_OBJECT Q_INTERFACES(QDeclarativePropertyValueInterceptor) public: - virtual void setTarget(const QDeclarativeMetaProperty &) {} + virtual void setTarget(const QDeclarativeProperty &) {} virtual void write(const QVariant &) {} }; QML_DECLARE_TYPE(ValueInterceptorTestType); diff --git a/tests/auto/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro b/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro index 7170469..22e50cc 100644 --- a/tests/auto/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro +++ b/tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro @@ -2,4 +2,4 @@ load(qttest_p4) contains(QT_CONFIG,declarative): QT += declarative macx:CONFIG -= app_bundle -SOURCES += tst_qdeclarativemetaproperty.cpp +SOURCES += tst_qdeclarativeproperty.cpp diff --git a/tests/auto/declarative/qdeclarativemetaproperty/tst_qdeclarativemetaproperty.cpp b/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp index a7e9d0d..d4b0808 100644 --- a/tests/auto/declarative/qdeclarativemetaproperty/tst_qdeclarativemetaproperty.cpp +++ b/tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp @@ -41,8 +41,8 @@ #include <qtest.h> #include <QtDeclarative/qdeclarativeengine.h> #include <QtDeclarative/qdeclarativecomponent.h> -#include <QtDeclarative/qdeclarativemetaproperty.h> -#include <QtDeclarative/private/qdeclarativemetaproperty_p.h> +#include <QtDeclarative/qdeclarativeproperty.h> +#include <QtDeclarative/private/qdeclarativeproperty_p.h> #include <private/qguard_p.h> #include <private/qdeclarativebinding_p.h> #include <QtGui/QLineEdit> @@ -90,11 +90,11 @@ private: QML_DECLARE_TYPE(MyContainer); QML_DECLARE_TYPEINFO(MyContainer, QML_HAS_ATTACHED_PROPERTIES) -class tst_qdeclarativemetaproperty : public QObject +class tst_qdeclarativeproperty : public QObject { Q_OBJECT public: - tst_qdeclarativemetaproperty() {} + tst_qdeclarativeproperty() {} private slots: void initTestCase(); @@ -126,9 +126,9 @@ private: QDeclarativeEngine engine; }; -void tst_qdeclarativemetaproperty::qmlmetaproperty() +void tst_qdeclarativeproperty::qmlmetaproperty() { - QDeclarativeMetaProperty prop; + QDeclarativeProperty prop; QGuard<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext())); QVERIFY(binding != 0); @@ -149,7 +149,7 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty() QCOMPARE(prop.connectNotifier(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false); QCOMPARE(prop.connectNotifier(obj, -1), false); QVERIFY(prop.method().signature() == 0); - QCOMPARE(prop.type(), QDeclarativeMetaProperty::Invalid); + QCOMPARE(prop.type(), QDeclarativeProperty::Invalid); QCOMPARE(prop.isProperty(), false); QCOMPARE(prop.isDefault(), false); QCOMPARE(prop.isWritable(), false); @@ -157,18 +157,18 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty() QCOMPARE(prop.isResettable(), false); QCOMPARE(prop.isValid(), false); QCOMPARE(prop.object(), (QObject *)0); - QCOMPARE(prop.propertyTypeCategory(), QDeclarativeMetaProperty::InvalidCategory); + QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::InvalidCategory); QCOMPARE(prop.propertyType(), 0); QCOMPARE(prop.propertyTypeName(), (const char *)0); QVERIFY(prop.property().name() == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0); + QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding) == 0); QVERIFY(binding == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0); + QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression) == 0); QVERIFY(expression == 0); QCOMPARE(prop.coreIndex(), -1); - QCOMPARE(QDeclarativeMetaPropertyPrivate::valueTypeCoreIndex(prop), -1); + QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1); delete obj; } @@ -210,13 +210,13 @@ private: QML_DECLARE_TYPE(PropertyObject); -void tst_qdeclarativemetaproperty::qmlmetaproperty_object() +void tst_qdeclarativeproperty::qmlmetaproperty_object() { QObject object; // Has no default property PropertyObject dobject; // Has default property { - QDeclarativeMetaProperty prop(&object); + QDeclarativeProperty prop(&object); QGuard<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext())); QVERIFY(binding != 0); @@ -237,7 +237,7 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object() QCOMPARE(prop.connectNotifier(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false); QCOMPARE(prop.connectNotifier(obj, -1), false); QVERIFY(prop.method().signature() == 0); - QCOMPARE(prop.type(), QDeclarativeMetaProperty::Invalid); + QCOMPARE(prop.type(), QDeclarativeProperty::Invalid); QCOMPARE(prop.isProperty(), false); QCOMPARE(prop.isDefault(), false); QCOMPARE(prop.isWritable(), false); @@ -245,24 +245,24 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object() QCOMPARE(prop.isResettable(), false); QCOMPARE(prop.isValid(), false); QCOMPARE(prop.object(), (QObject *)0); - QCOMPARE(prop.propertyTypeCategory(), QDeclarativeMetaProperty::InvalidCategory); + QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::InvalidCategory); QCOMPARE(prop.propertyType(), 0); QCOMPARE(prop.propertyTypeName(), (const char *)0); QVERIFY(prop.property().name() == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0); + QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding) == 0); QVERIFY(binding == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0); + QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression) == 0); QVERIFY(expression == 0); QCOMPARE(prop.coreIndex(), -1); - QCOMPARE(QDeclarativeMetaPropertyPrivate::valueTypeCoreIndex(prop), -1); + QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1); delete obj; } { - QDeclarativeMetaProperty prop(&dobject); + QDeclarativeProperty prop(&dobject); QGuard<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext())); binding->setTarget(prop); @@ -284,7 +284,7 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object() QCOMPARE(prop.connectNotifier(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false); QCOMPARE(prop.connectNotifier(obj, -1), false); QVERIFY(prop.method().signature() == 0); - QCOMPARE(prop.type(), (QDeclarativeMetaProperty::Type)(QDeclarativeMetaProperty::Property | QDeclarativeMetaProperty::Default)); + QCOMPARE(prop.type(), (QDeclarativeProperty::Type)(QDeclarativeProperty::Property | QDeclarativeProperty::Default)); QCOMPARE(prop.isProperty(), true); QCOMPARE(prop.isDefault(), true); QCOMPARE(prop.isWritable(), false); @@ -292,32 +292,32 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object() QCOMPARE(prop.isResettable(), false); QCOMPARE(prop.isValid(), true); QCOMPARE(prop.object(), &dobject); - QCOMPARE(prop.propertyTypeCategory(), QDeclarativeMetaProperty::Normal); + QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::Normal); QCOMPARE(prop.propertyType(), (int)QVariant::Int); QCOMPARE(prop.propertyTypeName(), "int"); QCOMPARE(QString(prop.property().name()), QString("defaultProperty")); - QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0); QTest::ignoreMessage(QtWarningMsg, "<Unknown File>:-1: Unable to assign null to int"); - QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0); + QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding) == 0); QVERIFY(binding != 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == binding); - QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0); + QVERIFY(QDeclarativePropertyPrivate::binding(prop) == binding); + QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression) == 0); QVERIFY(expression == 0); QCOMPARE(prop.coreIndex(), dobject.metaObject()->indexOfProperty("defaultProperty")); - QCOMPARE(QDeclarativeMetaPropertyPrivate::valueTypeCoreIndex(prop), -1); + QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1); delete obj; } } -void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string() +void tst_qdeclarativeproperty::qmlmetaproperty_object_string() { QObject object; PropertyObject dobject; { - QDeclarativeMetaProperty prop(&object, QString("defaultProperty")); + QDeclarativeProperty prop(&object, QString("defaultProperty")); QGuard<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext())); QVERIFY(binding != 0); @@ -338,7 +338,7 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string() QCOMPARE(prop.connectNotifier(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false); QCOMPARE(prop.connectNotifier(obj, -1), false); QVERIFY(prop.method().signature() == 0); - QCOMPARE(prop.type(), QDeclarativeMetaProperty::Invalid); + QCOMPARE(prop.type(), QDeclarativeProperty::Invalid); QCOMPARE(prop.isProperty(), false); QCOMPARE(prop.isDefault(), false); QCOMPARE(prop.isWritable(), false); @@ -346,24 +346,24 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string() QCOMPARE(prop.isResettable(), false); QCOMPARE(prop.isValid(), false); QCOMPARE(prop.object(), (QObject *)0); - QCOMPARE(prop.propertyTypeCategory(), QDeclarativeMetaProperty::InvalidCategory); + QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::InvalidCategory); QCOMPARE(prop.propertyType(), 0); QCOMPARE(prop.propertyTypeName(), (const char *)0); QVERIFY(prop.property().name() == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0); + QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding) == 0); QVERIFY(binding == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0); + QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression) == 0); QVERIFY(expression == 0); QCOMPARE(prop.coreIndex(), -1); - QCOMPARE(QDeclarativeMetaPropertyPrivate::valueTypeCoreIndex(prop), -1); + QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1); delete obj; } { - QDeclarativeMetaProperty prop(&dobject, QString("defaultProperty")); + QDeclarativeProperty prop(&dobject, QString("defaultProperty")); QGuard<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext())); binding->setTarget(prop); @@ -385,7 +385,7 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string() QCOMPARE(prop.connectNotifier(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false); QCOMPARE(prop.connectNotifier(obj, -1), false); QVERIFY(prop.method().signature() == 0); - QCOMPARE(prop.type(), QDeclarativeMetaProperty::Property); + QCOMPARE(prop.type(), QDeclarativeProperty::Property); QCOMPARE(prop.isProperty(), true); QCOMPARE(prop.isDefault(), false); QCOMPARE(prop.isWritable(), false); @@ -393,26 +393,26 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string() QCOMPARE(prop.isResettable(), false); QCOMPARE(prop.isValid(), true); QCOMPARE(prop.object(), &dobject); - QCOMPARE(prop.propertyTypeCategory(), QDeclarativeMetaProperty::Normal); + QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::Normal); QCOMPARE(prop.propertyType(), (int)QVariant::Int); QCOMPARE(prop.propertyTypeName(), "int"); QCOMPARE(QString(prop.property().name()), QString("defaultProperty")); - QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0); QTest::ignoreMessage(QtWarningMsg, "<Unknown File>:-1: Unable to assign null to int"); - QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0); + QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding) == 0); QVERIFY(binding != 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == binding); - QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0); + QVERIFY(QDeclarativePropertyPrivate::binding(prop) == binding); + QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression) == 0); QVERIFY(expression == 0); QCOMPARE(prop.coreIndex(), dobject.metaObject()->indexOfProperty("defaultProperty")); - QCOMPARE(QDeclarativeMetaPropertyPrivate::valueTypeCoreIndex(prop), -1); + QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1); delete obj; } { - QDeclarativeMetaProperty prop(&dobject, QString("onClicked")); + QDeclarativeProperty prop(&dobject, QString("onClicked")); QGuard<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext())); binding->setTarget(prop); @@ -434,7 +434,7 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string() QCOMPARE(prop.connectNotifier(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false); QCOMPARE(prop.connectNotifier(obj, -1), false); QCOMPARE(QString(prop.method().signature()), QString("clicked()")); - QCOMPARE(prop.type(), QDeclarativeMetaProperty::SignalProperty); + QCOMPARE(prop.type(), QDeclarativeProperty::SignalProperty); QCOMPARE(prop.isProperty(), false); QCOMPARE(prop.isDefault(), false); QCOMPARE(prop.isWritable(), false); @@ -442,31 +442,31 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string() QCOMPARE(prop.isResettable(), false); QCOMPARE(prop.isValid(), true); QCOMPARE(prop.object(), &dobject); - QCOMPARE(prop.propertyTypeCategory(), QDeclarativeMetaProperty::InvalidCategory); + QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::InvalidCategory); QCOMPARE(prop.propertyType(), 0); QCOMPARE(prop.propertyTypeName(), (const char *)0); QCOMPARE(prop.property().name(), (const char *)0); - QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0); + QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding) == 0); QVERIFY(binding == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0); + QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression) == 0); QVERIFY(expression != 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == expression); + QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == expression); QCOMPARE(prop.coreIndex(), dobject.metaObject()->indexOfMethod("clicked()")); - QCOMPARE(QDeclarativeMetaPropertyPrivate::valueTypeCoreIndex(prop), -1); + QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1); delete obj; } } -void tst_qdeclarativemetaproperty::qmlmetaproperty_object_context() +void tst_qdeclarativeproperty::qmlmetaproperty_object_context() { QObject object; // Has no default property PropertyObject dobject; // Has default property { - QDeclarativeMetaProperty prop(&object, engine.rootContext()); + QDeclarativeProperty prop(&object, engine.rootContext()); QGuard<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext())); QVERIFY(binding != 0); @@ -487,7 +487,7 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_context() QCOMPARE(prop.connectNotifier(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false); QCOMPARE(prop.connectNotifier(obj, -1), false); QVERIFY(prop.method().signature() == 0); - QCOMPARE(prop.type(), QDeclarativeMetaProperty::Invalid); + QCOMPARE(prop.type(), QDeclarativeProperty::Invalid); QCOMPARE(prop.isProperty(), false); QCOMPARE(prop.isDefault(), false); QCOMPARE(prop.isWritable(), false); @@ -495,24 +495,24 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_context() QCOMPARE(prop.isResettable(), false); QCOMPARE(prop.isValid(), false); QCOMPARE(prop.object(), (QObject *)0); - QCOMPARE(prop.propertyTypeCategory(), QDeclarativeMetaProperty::InvalidCategory); + QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::InvalidCategory); QCOMPARE(prop.propertyType(), 0); QCOMPARE(prop.propertyTypeName(), (const char *)0); QVERIFY(prop.property().name() == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0); + QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding) == 0); QVERIFY(binding == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0); + QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression) == 0); QVERIFY(expression == 0); QCOMPARE(prop.coreIndex(), -1); - QCOMPARE(QDeclarativeMetaPropertyPrivate::valueTypeCoreIndex(prop), -1); + QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1); delete obj; } { - QDeclarativeMetaProperty prop(&dobject, engine.rootContext()); + QDeclarativeProperty prop(&dobject, engine.rootContext()); QGuard<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext())); binding->setTarget(prop); @@ -534,7 +534,7 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_context() QCOMPARE(prop.connectNotifier(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false); QCOMPARE(prop.connectNotifier(obj, -1), false); QVERIFY(prop.method().signature() == 0); - QCOMPARE(prop.type(), (QDeclarativeMetaProperty::Type)(QDeclarativeMetaProperty::Property | QDeclarativeMetaProperty::Default)); + QCOMPARE(prop.type(), (QDeclarativeProperty::Type)(QDeclarativeProperty::Property | QDeclarativeProperty::Default)); QCOMPARE(prop.isProperty(), true); QCOMPARE(prop.isDefault(), true); QCOMPARE(prop.isWritable(), false); @@ -542,32 +542,32 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_context() QCOMPARE(prop.isResettable(), false); QCOMPARE(prop.isValid(), true); QCOMPARE(prop.object(), &dobject); - QCOMPARE(prop.propertyTypeCategory(), QDeclarativeMetaProperty::Normal); + QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::Normal); QCOMPARE(prop.propertyType(), (int)QVariant::Int); QCOMPARE(prop.propertyTypeName(), "int"); QCOMPARE(QString(prop.property().name()), QString("defaultProperty")); - QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0); QTest::ignoreMessage(QtWarningMsg, "<Unknown File>:-1: Unable to assign null to int"); - QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0); + QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding) == 0); QVERIFY(binding != 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == binding); - QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0); + QVERIFY(QDeclarativePropertyPrivate::binding(prop) == binding); + QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression) == 0); QVERIFY(expression == 0); QCOMPARE(prop.coreIndex(), dobject.metaObject()->indexOfProperty("defaultProperty")); - QCOMPARE(QDeclarativeMetaPropertyPrivate::valueTypeCoreIndex(prop), -1); + QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1); delete obj; } } -void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string_context() +void tst_qdeclarativeproperty::qmlmetaproperty_object_string_context() { QObject object; PropertyObject dobject; { - QDeclarativeMetaProperty prop(&object, QString("defaultProperty"), engine.rootContext()); + QDeclarativeProperty prop(&object, QString("defaultProperty"), engine.rootContext()); QGuard<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext())); QVERIFY(binding != 0); @@ -588,7 +588,7 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string_context() QCOMPARE(prop.connectNotifier(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false); QCOMPARE(prop.connectNotifier(obj, -1), false); QVERIFY(prop.method().signature() == 0); - QCOMPARE(prop.type(), QDeclarativeMetaProperty::Invalid); + QCOMPARE(prop.type(), QDeclarativeProperty::Invalid); QCOMPARE(prop.isProperty(), false); QCOMPARE(prop.isDefault(), false); QCOMPARE(prop.isWritable(), false); @@ -596,24 +596,24 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string_context() QCOMPARE(prop.isResettable(), false); QCOMPARE(prop.isValid(), false); QCOMPARE(prop.object(), (QObject *)0); - QCOMPARE(prop.propertyTypeCategory(), QDeclarativeMetaProperty::InvalidCategory); + QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::InvalidCategory); QCOMPARE(prop.propertyType(), 0); QCOMPARE(prop.propertyTypeName(), (const char *)0); QVERIFY(prop.property().name() == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0); + QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding) == 0); QVERIFY(binding == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0); + QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression) == 0); QVERIFY(expression == 0); QCOMPARE(prop.coreIndex(), -1); - QCOMPARE(QDeclarativeMetaPropertyPrivate::valueTypeCoreIndex(prop), -1); + QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1); delete obj; } { - QDeclarativeMetaProperty prop(&dobject, QString("defaultProperty"), engine.rootContext()); + QDeclarativeProperty prop(&dobject, QString("defaultProperty"), engine.rootContext()); QGuard<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext())); binding->setTarget(prop); @@ -635,7 +635,7 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string_context() QCOMPARE(prop.connectNotifier(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false); QCOMPARE(prop.connectNotifier(obj, -1), false); QVERIFY(prop.method().signature() == 0); - QCOMPARE(prop.type(), QDeclarativeMetaProperty::Property); + QCOMPARE(prop.type(), QDeclarativeProperty::Property); QCOMPARE(prop.isProperty(), true); QCOMPARE(prop.isDefault(), false); QCOMPARE(prop.isWritable(), false); @@ -643,26 +643,26 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string_context() QCOMPARE(prop.isResettable(), false); QCOMPARE(prop.isValid(), true); QCOMPARE(prop.object(), &dobject); - QCOMPARE(prop.propertyTypeCategory(), QDeclarativeMetaProperty::Normal); + QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::Normal); QCOMPARE(prop.propertyType(), (int)QVariant::Int); QCOMPARE(prop.propertyTypeName(), "int"); QCOMPARE(QString(prop.property().name()), QString("defaultProperty")); - QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0); QTest::ignoreMessage(QtWarningMsg, "<Unknown File>:-1: Unable to assign null to int"); - QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0); + QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding) == 0); QVERIFY(binding != 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == binding); - QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0); + QVERIFY(QDeclarativePropertyPrivate::binding(prop) == binding); + QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression) == 0); QVERIFY(expression == 0); QCOMPARE(prop.coreIndex(), dobject.metaObject()->indexOfProperty("defaultProperty")); - QCOMPARE(QDeclarativeMetaPropertyPrivate::valueTypeCoreIndex(prop), -1); + QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1); delete obj; } { - QDeclarativeMetaProperty prop(&dobject, QString("onClicked"), engine.rootContext()); + QDeclarativeProperty prop(&dobject, QString("onClicked"), engine.rootContext()); QGuard<QDeclarativeBinding> binding(new QDeclarativeBinding(QLatin1String("null"), 0, engine.rootContext())); binding->setTarget(prop); @@ -684,7 +684,7 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string_context() QCOMPARE(prop.connectNotifier(obj, obj->metaObject()->indexOfMethod("deleteLater()")), false); QCOMPARE(prop.connectNotifier(obj, -1), false); QCOMPARE(QString(prop.method().signature()), QString("clicked()")); - QCOMPARE(prop.type(), QDeclarativeMetaProperty::SignalProperty); + QCOMPARE(prop.type(), QDeclarativeProperty::SignalProperty); QCOMPARE(prop.isProperty(), false); QCOMPARE(prop.isDefault(), false); QCOMPARE(prop.isWritable(), false); @@ -692,104 +692,104 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string_context() QCOMPARE(prop.isResettable(), false); QCOMPARE(prop.isValid(), true); QCOMPARE(prop.object(), &dobject); - QCOMPARE(prop.propertyTypeCategory(), QDeclarativeMetaProperty::InvalidCategory); + QCOMPARE(prop.propertyTypeCategory(), QDeclarativeProperty::InvalidCategory); QCOMPARE(prop.propertyType(), 0); QCOMPARE(prop.propertyTypeName(), (const char *)0); QCOMPARE(prop.property().name(), (const char *)0); - QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0); + QVERIFY(QDeclarativePropertyPrivate::binding(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setBinding(prop, binding) == 0); QVERIFY(binding == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0); + QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == 0); + QVERIFY(QDeclarativePropertyPrivate::setSignalExpression(prop, expression) == 0); QVERIFY(expression != 0); - QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == expression); + QVERIFY(QDeclarativePropertyPrivate::signalExpression(prop) == expression); QCOMPARE(prop.coreIndex(), dobject.metaObject()->indexOfMethod("clicked()")); - QCOMPARE(QDeclarativeMetaPropertyPrivate::valueTypeCoreIndex(prop), -1); + QCOMPARE(QDeclarativePropertyPrivate::valueTypeCoreIndex(prop), -1); delete obj; } } -void tst_qdeclarativemetaproperty::name() +void tst_qdeclarativeproperty::name() { { - QDeclarativeMetaProperty p; + QDeclarativeProperty p; QCOMPARE(p.name(), QString()); } { PropertyObject o; - QDeclarativeMetaProperty p(&o); + QDeclarativeProperty p(&o); QCOMPARE(p.name(), QString("defaultProperty")); } { QObject o; - QDeclarativeMetaProperty p(&o, QString("objectName")); + QDeclarativeProperty p(&o, QString("objectName")); QCOMPARE(p.name(), QString("objectName")); } { PropertyObject o; - QDeclarativeMetaProperty p(&o, "onClicked"); + QDeclarativeProperty p(&o, "onClicked"); QCOMPARE(p.name(), QString("onClicked")); } { QObject o; - QDeclarativeMetaProperty p(&o, "onClicked"); + QDeclarativeProperty p(&o, "onClicked"); QCOMPARE(p.name(), QString()); } { QObject o; - QDeclarativeMetaProperty p(&o, "foo"); + QDeclarativeProperty p(&o, "foo"); QCOMPARE(p.name(), QString()); } { - QDeclarativeMetaProperty p(0, "foo"); + QDeclarativeProperty p(0, "foo"); QCOMPARE(p.name(), QString()); } { PropertyObject o; - QDeclarativeMetaProperty p(&o, "rectProperty"); + QDeclarativeProperty p(&o, "rectProperty"); QCOMPARE(p.name(), QString("rectProperty")); } { PropertyObject o; - QDeclarativeMetaProperty p(&o, "rectProperty.x"); + QDeclarativeProperty p(&o, "rectProperty.x"); QCOMPARE(p.name(), QString("rectProperty.x")); } { PropertyObject o; - QDeclarativeMetaProperty p(&o, "rectProperty.foo"); + QDeclarativeProperty p(&o, "rectProperty.foo"); QCOMPARE(p.name(), QString()); } } -void tst_qdeclarativemetaproperty::read() +void tst_qdeclarativeproperty::read() { // Invalid { - QDeclarativeMetaProperty p; + QDeclarativeProperty p; QCOMPARE(p.read(), QVariant()); } // Default prop { PropertyObject o; - QDeclarativeMetaProperty p(&o); + QDeclarativeProperty p(&o); QCOMPARE(p.read(), QVariant(10)); } // Invalid default prop { QObject o; - QDeclarativeMetaProperty p(&o); + QDeclarativeProperty p(&o); QCOMPARE(p.read(), QVariant()); } @@ -797,7 +797,7 @@ void tst_qdeclarativemetaproperty::read() { QObject o; - QDeclarativeMetaProperty p(&o, "objectName"); + QDeclarativeProperty p(&o, "objectName"); QCOMPARE(p.read(), QVariant(QString())); o.setObjectName("myName"); @@ -808,25 +808,25 @@ void tst_qdeclarativemetaproperty::read() // Value-type prop { PropertyObject o; - QDeclarativeMetaProperty p(&o, "rectProperty.x"); + QDeclarativeProperty p(&o, "rectProperty.x"); QCOMPARE(p.read(), QVariant(10)); } // Invalid value-type prop { PropertyObject o; - QDeclarativeMetaProperty p(&o, "rectProperty.foo"); + QDeclarativeProperty p(&o, "rectProperty.foo"); QCOMPARE(p.read(), QVariant()); } // Signal property { PropertyObject o; - QDeclarativeMetaProperty p(&o, "onClicked"); + QDeclarativeProperty p(&o, "onClicked"); QCOMPARE(p.read(), QVariant()); - QVERIFY(0 == QDeclarativeMetaPropertyPrivate::setSignalExpression(p, new QDeclarativeExpression())); - QVERIFY(0 != QDeclarativeMetaPropertyPrivate::signalExpression(p)); + QVERIFY(0 == QDeclarativePropertyPrivate::setSignalExpression(p, new QDeclarativeExpression())); + QVERIFY(0 != QDeclarativePropertyPrivate::signalExpression(p)); QCOMPARE(p.read(), QVariant()); } @@ -834,7 +834,7 @@ void tst_qdeclarativemetaproperty::read() // Deleted object { PropertyObject *o = new PropertyObject; - QDeclarativeMetaProperty p(o, "rectProperty.x"); + QDeclarativeProperty p(o, "rectProperty.x"); QCOMPARE(p.read(), QVariant(10)); delete o; QCOMPARE(p.read(), QVariant()); @@ -847,7 +847,7 @@ void tst_qdeclarativemetaproperty::read() QObject *object = component.create(); QVERIFY(object != 0); - QDeclarativeMetaProperty p(object, "MyContainer.foo", qmlContext(object)); + QDeclarativeProperty p(object, "MyContainer.foo", qmlContext(object)); QCOMPARE(p.read(), QVariant(13)); delete object; } @@ -857,7 +857,7 @@ void tst_qdeclarativemetaproperty::read() QObject *object = component.create(); QVERIFY(object != 0); - QDeclarativeMetaProperty p(object, "MyContainer.foo", qmlContext(object)); + QDeclarativeProperty p(object, "MyContainer.foo", qmlContext(object)); QCOMPARE(p.read(), QVariant(10)); delete object; } @@ -867,45 +867,45 @@ void tst_qdeclarativemetaproperty::read() QObject *object = component.create(); QVERIFY(object != 0); - QDeclarativeMetaProperty p(object, "Foo.MyContainer.foo", qmlContext(object)); + QDeclarativeProperty p(object, "Foo.MyContainer.foo", qmlContext(object)); QCOMPARE(p.read(), QVariant(10)); delete object; } } -void tst_qdeclarativemetaproperty::write() +void tst_qdeclarativeproperty::write() { // Invalid { - QDeclarativeMetaProperty p; + QDeclarativeProperty p; QCOMPARE(p.write(QVariant(10)), false); } // Read-only default prop { PropertyObject o; - QDeclarativeMetaProperty p(&o); + QDeclarativeProperty p(&o); QCOMPARE(p.write(QVariant(10)), false); } // Invalid default prop { QObject o; - QDeclarativeMetaProperty p(&o); + QDeclarativeProperty p(&o); QCOMPARE(p.write(QVariant(10)), false); } // Read-only prop by name { PropertyObject o; - QDeclarativeMetaProperty p(&o, QString("defaultProperty")); + QDeclarativeProperty p(&o, QString("defaultProperty")); QCOMPARE(p.write(QVariant(10)), false); } // Writable prop by name { PropertyObject o; - QDeclarativeMetaProperty p(&o, QString("objectName")); + QDeclarativeProperty p(&o, QString("objectName")); QCOMPARE(o.objectName(), QString()); QCOMPARE(p.write(QVariant(QString("myName"))), true); QCOMPARE(o.objectName(), QString("myName")); @@ -914,7 +914,7 @@ void tst_qdeclarativemetaproperty::write() // Deleted object { PropertyObject *o = new PropertyObject; - QDeclarativeMetaProperty p(o, QString("objectName")); + QDeclarativeProperty p(o, QString("objectName")); QCOMPARE(p.write(QVariant(QString("myName"))), true); QCOMPARE(o->objectName(), QString("myName")); @@ -926,27 +926,27 @@ void tst_qdeclarativemetaproperty::write() // Signal property { PropertyObject o; - QDeclarativeMetaProperty p(&o, "onClicked"); + QDeclarativeProperty p(&o, "onClicked"); QCOMPARE(p.write(QVariant("console.log(1921)")), false); - QVERIFY(0 == QDeclarativeMetaPropertyPrivate::setSignalExpression(p, new QDeclarativeExpression())); - QVERIFY(0 != QDeclarativeMetaPropertyPrivate::signalExpression(p)); + QVERIFY(0 == QDeclarativePropertyPrivate::setSignalExpression(p, new QDeclarativeExpression())); + QVERIFY(0 != QDeclarativePropertyPrivate::signalExpression(p)); QCOMPARE(p.write(QVariant("console.log(1921)")), false); - QVERIFY(0 != QDeclarativeMetaPropertyPrivate::signalExpression(p)); + QVERIFY(0 != QDeclarativePropertyPrivate::signalExpression(p)); } // Value-type property { PropertyObject o; - QDeclarativeMetaProperty p(&o, "wrectProperty"); + QDeclarativeProperty p(&o, "wrectProperty"); QCOMPARE(o.wrectProperty(), QRect()); QCOMPARE(p.write(QRect(1, 13, 99, 8)), true); QCOMPARE(o.wrectProperty(), QRect(1, 13, 99, 8)); - QDeclarativeMetaProperty p2(&o, "wrectProperty.x"); + QDeclarativeProperty p2(&o, "wrectProperty.x"); QCOMPARE(p2.read(), QVariant(1)); QCOMPARE(p2.write(QVariant(6)), true); QCOMPARE(p2.read(), QVariant(6)); @@ -956,12 +956,12 @@ void tst_qdeclarativemetaproperty::write() // URL-property { PropertyObject o; - QDeclarativeMetaProperty p(&o, "url"); + QDeclarativeProperty p(&o, "url"); QCOMPARE(p.write(QUrl("main.qml")), true); QCOMPARE(o.url(), QUrl("main.qml")); - QDeclarativeMetaProperty p2(&o, "url", engine.rootContext()); + QDeclarativeProperty p2(&o, "url", engine.rootContext()); QUrl result = engine.baseUrl().resolved(QUrl("main.qml")); QVERIFY(result != QUrl("main.qml")); @@ -977,7 +977,7 @@ void tst_qdeclarativemetaproperty::write() QObject *object = component.create(); QVERIFY(object != 0); - QDeclarativeMetaProperty p(object, "MyContainer.foo", qmlContext(object)); + QDeclarativeProperty p(object, "MyContainer.foo", qmlContext(object)); p.write(QVariant(99)); QCOMPARE(p.read(), QVariant(99)); delete object; @@ -988,18 +988,18 @@ void tst_qdeclarativemetaproperty::write() QObject *object = component.create(); QVERIFY(object != 0); - QDeclarativeMetaProperty p(object, "Foo.MyContainer.foo", qmlContext(object)); + QDeclarativeProperty p(object, "Foo.MyContainer.foo", qmlContext(object)); p.write(QVariant(99)); QCOMPARE(p.read(), QVariant(99)); delete object; } } -void tst_qdeclarativemetaproperty::reset() +void tst_qdeclarativeproperty::reset() { // Invalid { - QDeclarativeMetaProperty p; + QDeclarativeProperty p; QCOMPARE(p.isResettable(), false); QCOMPARE(p.reset(), false); } @@ -1007,7 +1007,7 @@ void tst_qdeclarativemetaproperty::reset() // Read-only default prop { PropertyObject o; - QDeclarativeMetaProperty p(&o); + QDeclarativeProperty p(&o); QCOMPARE(p.isResettable(), false); QCOMPARE(p.reset(), false); } @@ -1015,7 +1015,7 @@ void tst_qdeclarativemetaproperty::reset() // Invalid default prop { QObject o; - QDeclarativeMetaProperty p(&o); + QDeclarativeProperty p(&o); QCOMPARE(p.isResettable(), false); QCOMPARE(p.reset(), false); } @@ -1023,7 +1023,7 @@ void tst_qdeclarativemetaproperty::reset() // Non-resettable-only prop by name { PropertyObject o; - QDeclarativeMetaProperty p(&o, QString("defaultProperty")); + QDeclarativeProperty p(&o, QString("defaultProperty")); QCOMPARE(p.isResettable(), false); QCOMPARE(p.reset(), false); } @@ -1031,7 +1031,7 @@ void tst_qdeclarativemetaproperty::reset() // Resettable prop by name { PropertyObject o; - QDeclarativeMetaProperty p(&o, QString("resettableProperty")); + QDeclarativeProperty p(&o, QString("resettableProperty")); QCOMPARE(p.read(), QVariant(9)); QCOMPARE(p.write(QVariant(11)), true); @@ -1047,7 +1047,7 @@ void tst_qdeclarativemetaproperty::reset() { PropertyObject *o = new PropertyObject; - QDeclarativeMetaProperty p(o, QString("resettableProperty")); + QDeclarativeProperty p(o, QString("resettableProperty")); QCOMPARE(p.isResettable(), true); QCOMPARE(p.reset(), true); @@ -1061,14 +1061,14 @@ void tst_qdeclarativemetaproperty::reset() // Signal property { PropertyObject o; - QDeclarativeMetaProperty p(&o, "onClicked"); + QDeclarativeProperty p(&o, "onClicked"); QCOMPARE(p.isResettable(), false); QCOMPARE(p.reset(), false); } } -void tst_qdeclarativemetaproperty::writeObjectToList() +void tst_qdeclarativeproperty::writeObjectToList() { QDeclarativeComponent containerComponent(&engine); containerComponent.setData("import Test 1.0\nMyContainer { children: MyQmlObject {} }", QUrl()); @@ -1078,14 +1078,14 @@ void tst_qdeclarativemetaproperty::writeObjectToList() QVERIFY(list.count() == 1); MyQmlObject *object = new MyQmlObject; - QDeclarativeMetaProperty prop(container, "children"); + QDeclarativeProperty prop(container, "children"); prop.write(qVariantFromValue(object)); QCOMPARE(list.count(), 1); QCOMPARE(list.at(0), object); } Q_DECLARE_METATYPE(QList<QObject *>); -void tst_qdeclarativemetaproperty::writeListToList() +void tst_qdeclarativeproperty::writeListToList() { QDeclarativeComponent containerComponent(&engine); containerComponent.setData("import Test 1.0\nMyContainer { children: MyQmlObject {} }", QUrl()); @@ -1096,7 +1096,7 @@ void tst_qdeclarativemetaproperty::writeListToList() QList<QObject*> objList; objList << new MyQmlObject() << new MyQmlObject() << new MyQmlObject() << new MyQmlObject(); - QDeclarativeMetaProperty prop(container, "children"); + QDeclarativeProperty prop(container, "children"); prop.write(qVariantFromValue(objList)); QCOMPARE(list.count(), 4); @@ -1107,7 +1107,7 @@ void tst_qdeclarativemetaproperty::writeListToList() QCOMPARE(container->children()->size(), 1);*/ } -void tst_qdeclarativemetaproperty::crashOnValueProperty() +void tst_qdeclarativeproperty::crashOnValueProperty() { QDeclarativeEngine *engine = new QDeclarativeEngine; QDeclarativeComponent component(engine); @@ -1116,7 +1116,7 @@ void tst_qdeclarativemetaproperty::crashOnValueProperty() PropertyObject *obj = qobject_cast<PropertyObject*>(component.create()); QVERIFY(obj != 0); - QDeclarativeMetaProperty p(obj, "wrectProperty.x", qmlContext(obj)); + QDeclarativeProperty p(obj, "wrectProperty.x", qmlContext(obj)); QCOMPARE(p.name(), QString("wrectProperty.x")); QCOMPARE(p.read(), QVariant(10)); @@ -1131,49 +1131,49 @@ void tst_qdeclarativemetaproperty::crashOnValueProperty() QCOMPARE(p.read(), QVariant(20)); } -void tst_qdeclarativemetaproperty::copy() +void tst_qdeclarativeproperty::copy() { PropertyObject object; - QDeclarativeMetaProperty *property = new QDeclarativeMetaProperty(&object, QLatin1String("defaultProperty")); + QDeclarativeProperty *property = new QDeclarativeProperty(&object, QLatin1String("defaultProperty")); QCOMPARE(property->name(), QString("defaultProperty")); QCOMPARE(property->read(), QVariant(10)); - QCOMPARE(property->type(), QDeclarativeMetaProperty::Property); - QCOMPARE(property->propertyTypeCategory(), QDeclarativeMetaProperty::Normal); + QCOMPARE(property->type(), QDeclarativeProperty::Property); + QCOMPARE(property->propertyTypeCategory(), QDeclarativeProperty::Normal); QCOMPARE(property->propertyType(), (int)QVariant::Int); - QDeclarativeMetaProperty p1(*property); + QDeclarativeProperty p1(*property); QCOMPARE(p1.name(), QString("defaultProperty")); QCOMPARE(p1.read(), QVariant(10)); - QCOMPARE(p1.type(), QDeclarativeMetaProperty::Property); - QCOMPARE(p1.propertyTypeCategory(), QDeclarativeMetaProperty::Normal); + QCOMPARE(p1.type(), QDeclarativeProperty::Property); + QCOMPARE(p1.propertyTypeCategory(), QDeclarativeProperty::Normal); QCOMPARE(p1.propertyType(), (int)QVariant::Int); - QDeclarativeMetaProperty p2(&object, QLatin1String("url")); + QDeclarativeProperty p2(&object, QLatin1String("url")); QCOMPARE(p2.name(), QString("url")); p2 = *property; QCOMPARE(p2.name(), QString("defaultProperty")); QCOMPARE(p2.read(), QVariant(10)); - QCOMPARE(p2.type(), QDeclarativeMetaProperty::Property); - QCOMPARE(p2.propertyTypeCategory(), QDeclarativeMetaProperty::Normal); + QCOMPARE(p2.type(), QDeclarativeProperty::Property); + QCOMPARE(p2.propertyTypeCategory(), QDeclarativeProperty::Normal); QCOMPARE(p2.propertyType(), (int)QVariant::Int); delete property; property = 0; QCOMPARE(p1.name(), QString("defaultProperty")); QCOMPARE(p1.read(), QVariant(10)); - QCOMPARE(p1.type(), QDeclarativeMetaProperty::Property); - QCOMPARE(p1.propertyTypeCategory(), QDeclarativeMetaProperty::Normal); + QCOMPARE(p1.type(), QDeclarativeProperty::Property); + QCOMPARE(p1.propertyTypeCategory(), QDeclarativeProperty::Normal); QCOMPARE(p1.propertyType(), (int)QVariant::Int); QCOMPARE(p2.name(), QString("defaultProperty")); QCOMPARE(p2.read(), QVariant(10)); - QCOMPARE(p2.type(), QDeclarativeMetaProperty::Property); - QCOMPARE(p2.propertyTypeCategory(), QDeclarativeMetaProperty::Normal); + QCOMPARE(p2.type(), QDeclarativeProperty::Property); + QCOMPARE(p2.propertyTypeCategory(), QDeclarativeProperty::Normal); QCOMPARE(p2.propertyType(), (int)QVariant::Int); } -void tst_qdeclarativemetaproperty::initTestCase() +void tst_qdeclarativeproperty::initTestCase() { QML_REGISTER_TYPE(Test,1,0,MyQmlObject,MyQmlObject); QML_REGISTER_TYPE(Test,1,0,PropertyObject,PropertyObject); @@ -1181,6 +1181,6 @@ void tst_qdeclarativemetaproperty::initTestCase() } -QTEST_MAIN(tst_qdeclarativemetaproperty) +QTEST_MAIN(tst_qdeclarativeproperty) -#include "tst_qdeclarativemetaproperty.moc" +#include "tst_qdeclarativeproperty.moc" diff --git a/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h index 82a9c8a..dfc2829 100644 --- a/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h +++ b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h @@ -52,8 +52,8 @@ #include <QFont> #include <qdeclarative.h> #include <QDeclarativePropertyValueSource> -#include <QDeclarativeMetaProperty> -#include <private/qdeclarativemetaproperty_p.h> +#include <QDeclarativeProperty> +#include <private/qdeclarativeproperty_p.h> class MyTypeObject : public QObject { @@ -135,7 +135,7 @@ class MyConstantValueSource : public QObject, public QDeclarativePropertyValueSo { Q_OBJECT public: - virtual void setTarget(const QDeclarativeMetaProperty &p) { p.write(3345); } + virtual void setTarget(const QDeclarativeProperty &p) { p.write(3345); } }; QML_DECLARE_TYPE(MyConstantValueSource); @@ -143,11 +143,11 @@ class MyOffsetValueInterceptor : public QObject, public QDeclarativePropertyValu { Q_OBJECT public: - virtual void setTarget(const QDeclarativeMetaProperty &p) { prop = p; } - virtual void write(const QVariant &value) { QDeclarativeMetaPropertyPrivate::write(prop, value.toInt() + 13, QDeclarativeMetaPropertyPrivate::BypassInterceptor); } + virtual void setTarget(const QDeclarativeProperty &p) { prop = p; } + virtual void write(const QVariant &value) { QDeclarativePropertyPrivate::write(prop, value.toInt() + 13, QDeclarativePropertyPrivate::BypassInterceptor); } private: - QDeclarativeMetaProperty prop; + QDeclarativeProperty prop; }; QML_DECLARE_TYPE(MyOffsetValueInterceptor); |