summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAaron Kennedy <aaron.kennedy@nokia.com>2010-02-25 10:01:25 (GMT)
committerAaron Kennedy <aaron.kennedy@nokia.com>2010-02-25 10:02:54 (GMT)
commitf5bb807d6938fbd39ea1f99ed45c817d538e4287 (patch)
treeb3e1705e4703c5d7da5ffca3010d062644a62ae3 /tests
parent0e4dd15a90c119cea4ada833d88b51e336f53ee7 (diff)
downloadQt-f5bb807d6938fbd39ea1f99ed45c817d538e4287.zip
Qt-f5bb807d6938fbd39ea1f99ed45c817d538e4287.tar.gz
Qt-f5bb807d6938fbd39ea1f99ed45c817d538e4287.tar.bz2
Rename QDeclarativeMetaProperty -> QDeclarativeProperty
There's nothing meta about our properties.
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/declarative/declarative.pro2
-rw-r--r--tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/testtypes.h6
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp10
-rw-r--r--tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp12
-rw-r--r--tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp4
-rw-r--r--tests/auto/declarative/qdeclarativeproperty/qdeclarativeproperty.pro (renamed from tests/auto/declarative/qdeclarativemetaproperty/qdeclarativemetaproperty.pro)2
-rw-r--r--tests/auto/declarative/qdeclarativeproperty/tst_qdeclarativeproperty.cpp (renamed from tests/auto/declarative/qdeclarativemetaproperty/tst_qdeclarativemetaproperty.cpp)352
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/testtypes.h12
9 files changed, 203 insertions, 203 deletions
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);