summaryrefslogtreecommitdiffstats
path: root/tests/auto/declarative
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2010-02-25 05:50:23 (GMT)
committerBea Lam <bea.lam@nokia.com>2010-02-25 05:50:23 (GMT)
commit410dd39d7294cd0c9e46e01f839c137482d9fc5d (patch)
tree0b80cf8aab30e3adcbee39169ce389ad4177ec45 /tests/auto/declarative
parentd654f87319408e3d9754fa5a8ad376c3eaef4489 (diff)
parentf29a6c8b9fbeb899997c1e4cc2a4be009a231502 (diff)
downloadQt-410dd39d7294cd0c9e46e01f839c137482d9fc5d.zip
Qt-410dd39d7294cd0c9e46e01f839c137482d9fc5d.tar.gz
Qt-410dd39d7294cd0c9e46e01f839c137482d9fc5d.tar.bz2
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt-qml
Conflicts: src/declarative/qml/qdeclarativemetaproperty.cpp
Diffstat (limited to 'tests/auto/declarative')
-rw-r--r--tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml1
-rw-r--r--tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp2
-rw-r--r--tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp6
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/setindex.qml33
-rw-r--r--tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp15
-rw-r--r--tests/auto/declarative/qdeclarativeimage/data/colors1.pngbin0 -> 1655 bytes
-rw-r--r--tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp20
-rw-r--r--tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml (renamed from tests/auto/declarative/qdeclarativeinfo/data/qdeclarativeObject.qml)0
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml (renamed from tests/auto/declarative/qdeclarativelanguage/data/qdeclarativeAttachedPropertiesObjectMethod.1.qml)0
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml (renamed from tests/auto/declarative/qdeclarativelanguage/data/qdeclarativeAttachedPropertiesObjectMethod.2.qml)0
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/script.12.errors.txt2
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/testtypes.h1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp5
-rw-r--r--tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp1
-rw-r--r--tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml1
-rw-r--r--tests/auto/declarative/qdeclarativemetaproperty/tst_qdeclarativemetaproperty.cpp137
-rw-r--r--tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp3
-rw-r--r--tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp1
-rw-r--r--tests/auto/declarative/qdeclarativevaluetypes/testtypes.h1
19 files changed, 148 insertions, 81 deletions
diff --git a/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml b/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml
index 70fafd6..c00173d 100644
--- a/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml
+++ b/tests/auto/declarative/graphicswidgets/data/graphicswidgets.qml
@@ -1,4 +1,5 @@
import Qt 4.6
+import Qt.widgets 4.6
QGraphicsView {
objectName: "GView"
diff --git a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp b/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp
index b2ef16b..8aeba6d 100644
--- a/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp
+++ b/tests/auto/declarative/qdeclarativeborderimage/tst_qdeclarativeborderimage.cpp
@@ -60,7 +60,7 @@
#define TRY_WAIT(expr) \
do { \
- for (int ii = 0; ii < 6; ++ii) { \
+ for (int ii = 0; ii < 60; ++ii) { \
if ((expr)) break; \
QTest::qWait(50); \
} \
diff --git a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
index 1c8cbbc..8d5a1f6 100644
--- a/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
+++ b/tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp
@@ -49,7 +49,6 @@
#include <QtDeclarative/qdeclarativecontext.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativeexpression.h>
-#include <QtDeclarative/qdeclarativemetatype.h>
#include <QtDeclarative/qdeclarativemetaproperty.h>
#include <private/qdeclarativebinding_p.h>
@@ -58,6 +57,8 @@
#include <private/qdeclarativedebugclient_p.h>
#include <private/qdeclarativedebugservice_p.h>
#include <private/qdeclarativerectangle_p.h>
+#include <private/qdeclarativemetatype_p.h>
+#include <private/qdeclarativemetaproperty_p.h>
#include "../shared/debugutil_p.h"
@@ -216,7 +217,8 @@ void tst_QDeclarativeDebug::recursiveObjectTest(QObject *o, const QDeclarativeDe
else
QCOMPARE(p.valueTypeName(), QString::fromUtf8(pmeta.typeName()));
- QDeclarativeAbstractBinding *binding = QDeclarativeMetaProperty(o, p.name()).binding();
+ QDeclarativeAbstractBinding *binding =
+ QDeclarativeMetaPropertyPrivate::binding(QDeclarativeMetaProperty(o, p.name()));
if (binding)
QCOMPARE(binding->expression(), p.binding());
diff --git a/tests/auto/declarative/qdeclarativegridview/data/setindex.qml b/tests/auto/declarative/qdeclarativegridview/data/setindex.qml
new file mode 100644
index 0000000..908b365
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativegridview/data/setindex.qml
@@ -0,0 +1,33 @@
+import Qt 4.6
+
+Rectangle {
+ width: 200
+ height: 200
+ Component {
+ id: appDelegate
+
+ Item {
+ id : wrapper
+ Script {
+ function startupFunction()
+ {
+ if (index == 5) view.currentIndex = index;
+
+ }
+ }
+ Component.onCompleted: startupFunction();
+ width: 30; height: 30
+ Text { text: index }
+ }
+ }
+
+ GridView {
+ id: view
+ objectName: "grid"
+ anchors.fill: parent
+ cellWidth: 30; cellHeight: 30
+ model: 35
+ delegate: appDelegate
+ focus: true
+ }
+}
diff --git a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
index 9a7f517..9c7468d 100644
--- a/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
+++ b/tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp
@@ -66,6 +66,7 @@ private slots:
void defaultValues();
void properties();
void positionViewAtIndex();
+ void QTBUG_8456();
private:
QDeclarativeView *createView();
@@ -657,6 +658,7 @@ void tst_QDeclarativeGridView::currentIndex()
gridview->setFlow(QDeclarativeGridView::TopToBottom);
+ QEXPECT_FAIL("", "QTBUG-8475", Abort);
QTest::keyClick(canvas, Qt::Key_Right);
QCOMPARE(gridview->currentIndex(), 5);
@@ -882,6 +884,19 @@ void tst_QDeclarativeGridView::positionViewAtIndex()
delete canvas;
}
+void tst_QDeclarativeGridView::QTBUG_8456()
+{
+ QDeclarativeView *canvas = createView();
+
+ canvas->setSource(QUrl::fromLocalFile(SRCDIR "/data/setindex.qml"));
+ qApp->processEvents();
+
+ QDeclarativeGridView *gridview = findItem<QDeclarativeGridView>(canvas->rootObject(), "grid");
+ QVERIFY(gridview != 0);
+
+ QCOMPARE(gridview->currentIndex(), 0);
+}
+
QDeclarativeView *tst_QDeclarativeGridView::createView()
{
QDeclarativeView *canvas = new QDeclarativeView(0);
diff --git a/tests/auto/declarative/qdeclarativeimage/data/colors1.png b/tests/auto/declarative/qdeclarativeimage/data/colors1.png
new file mode 100644
index 0000000..dfb62f3
--- /dev/null
+++ b/tests/auto/declarative/qdeclarativeimage/data/colors1.png
Binary files differ
diff --git a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
index f38fca9..ed2095b 100644
--- a/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
+++ b/tests/auto/declarative/qdeclarativeimage/tst_qdeclarativeimage.cpp
@@ -59,7 +59,7 @@
#define TRY_WAIT(expr) \
do { \
- for (int ii = 0; ii < 6; ++ii) { \
+ for (int ii = 0; ii < 60; ++ii) { \
if ((expr)) break; \
QTest::qWait(50); \
} \
@@ -112,13 +112,17 @@ void tst_qdeclarativeimage::imageSource_data()
{
QTest::addColumn<QString>("source");
QTest::addColumn<bool>("remote");
+ QTest::addColumn<bool>("async");
QTest::addColumn<QString>("error");
- QTest::newRow("local") << QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() << false << "";
+ QTest::newRow("local") << QUrl::fromLocalFile(SRCDIR "/data/colors.png").toString() << false << false << "";
+ QTest::newRow("local async") << QUrl::fromLocalFile(SRCDIR "/data/colors1.png").toString() << false << true << "";
QTest::newRow("local not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString() << false
- << "Cannot open QUrl( \"" + QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString() + "\" ) ";
- QTest::newRow("remote") << SERVER_ADDR "/colors.png" << true << "";
- QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << true
+ << false << "Cannot open QUrl( \"" + QUrl::fromLocalFile(SRCDIR "/data/no-such-file.png").toString() + "\" ) ";
+ QTest::newRow("local async not found") << QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString() << false
+ << true << "\"Cannot open: " + QUrl::fromLocalFile(SRCDIR "/data/no-such-file-1.png").toString() + "\" ";
+ QTest::newRow("remote") << SERVER_ADDR "/colors.png" << true << false << "";
+ QTest::newRow("remote not found") << SERVER_ADDR "/no-such-file.png" << true << false
<< "\"Error downloading " SERVER_ADDR "/no-such-file.png - server replied: Not found\" ";
}
@@ -126,6 +130,7 @@ void tst_qdeclarativeimage::imageSource()
{
QFETCH(QString, source);
QFETCH(bool, remote);
+ QFETCH(bool, async);
QFETCH(QString, error);
TestHTTPServer server(SERVER_PORT);
@@ -137,13 +142,14 @@ void tst_qdeclarativeimage::imageSource()
if (!error.isEmpty())
QTest::ignoreMessage(QtWarningMsg, error.toUtf8());
- QString componentStr = "import Qt 4.6\nImage { source: \"" + source + "\" }";
+ QString componentStr = "import Qt 4.6\nImage { source: \"" + source + "\"; asynchronous: "
+ + (async ? QLatin1String("true") : QLatin1String("false")) + " }";
QDeclarativeComponent component(&engine);
component.setData(componentStr.toLatin1(), QUrl::fromLocalFile(""));
QDeclarativeImage *obj = qobject_cast<QDeclarativeImage*>(component.create());
QVERIFY(obj != 0);
- if (remote)
+ if (remote || async)
TRY_WAIT(obj->status() == QDeclarativeImage::Loading);
QCOMPARE(obj->source(), remote ? source : QUrl(source));
diff --git a/tests/auto/declarative/qdeclarativeinfo/data/qdeclarativeObject.qml b/tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml
index ce05f89..ce05f89 100644
--- a/tests/auto/declarative/qdeclarativeinfo/data/qdeclarativeObject.qml
+++ b/tests/auto/declarative/qdeclarativeinfo/data/qmlObject.qml
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/qdeclarativeAttachedPropertiesObjectMethod.1.qml b/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml
index 429c327..429c327 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/qdeclarativeAttachedPropertiesObjectMethod.1.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.1.qml
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/qdeclarativeAttachedPropertiesObjectMethod.2.qml b/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml
index 0f57b61..0f57b61 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/qdeclarativeAttachedPropertiesObjectMethod.2.qml
+++ b/tests/auto/declarative/qdeclarativelanguage/data/qmlAttachedPropertiesObjectMethod.2.qml
diff --git a/tests/auto/declarative/qdeclarativelanguage/data/script.12.errors.txt b/tests/auto/declarative/qdeclarativelanguage/data/script.12.errors.txt
index 85c8396..f8297f5 100644
--- a/tests/auto/declarative/qdeclarativelanguage/data/script.12.errors.txt
+++ b/tests/auto/declarative/qdeclarativelanguage/data/script.12.errors.txt
@@ -1 +1 @@
-4:5:QmlJS declaration outside Script element
+4:5:JavaScript declaration outside Script element
diff --git a/tests/auto/declarative/qdeclarativelanguage/testtypes.h b/tests/auto/declarative/qdeclarativelanguage/testtypes.h
index 1a8bd11..fc1ede7 100644
--- a/tests/auto/declarative/qdeclarativelanguage/testtypes.h
+++ b/tests/auto/declarative/qdeclarativelanguage/testtypes.h
@@ -52,6 +52,7 @@
#include <QtDeclarative/qdeclarativeparserstatus.h>
#include <QtDeclarative/qdeclarativepropertyvaluesource.h>
#include <QtDeclarative/qdeclarativescriptstring.h>
+#include <QtDeclarative/qdeclarativemetaproperty.h>
QVariant myCustomVariantTypeConverter(const QString &data);
diff --git a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
index 9d68ba9..2907757 100644
--- a/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
+++ b/tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp
@@ -45,7 +45,10 @@
#include <QtCore/qdebug.h>
#include <QtCore/qfileinfo.h>
#include <QtCore/qdir.h>
+
#include <private/qdeclarativemetaproperty_p.h>
+#include <private/qdeclarativemetatype_p.h>
+
#include "testtypes.h"
#include "../../../shared/util.h"
@@ -744,7 +747,7 @@ void tst_qdeclarativelanguage::valueTypes()
// ###
#if 0
- QDeclarativeMetaProperty p = QDeclarativeMetaProperty::createProperty(object, "rectProperty.x");
+ QDeclarativeMetaProperty p(object, "rectProperty.x");
QCOMPARE(p.read(), QVariant(12));
p.write(13);
QCOMPARE(p.read(), QVariant(13));
diff --git a/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp b/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp
index 03d641d..5c6ceef 100644
--- a/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp
+++ b/tests/auto/declarative/qdeclarativelistreference/tst_qdeclarativelistreference.cpp
@@ -47,6 +47,7 @@
#include <QDeclarativeComponent>
#include <QtDeclarative/qdeclarative.h>
#include <QtDeclarative/qdeclarativeprivate.h>
+#include <QtDeclarative/qdeclarativemetaproperty.h>
#include <QDebug>
inline QUrl TEST_FILE(const QString &filename)
diff --git a/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml b/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml
index 627c7df..4ebf366 100644
--- a/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml
+++ b/tests/auto/declarative/qdeclarativeloader/data/GraphicsWidget250x250.qml
@@ -1,4 +1,5 @@
import Qt 4.6
+import Qt.widgets 4.6
QGraphicsWidget {
size: "250x250"
diff --git a/tests/auto/declarative/qdeclarativemetaproperty/tst_qdeclarativemetaproperty.cpp b/tests/auto/declarative/qdeclarativemetaproperty/tst_qdeclarativemetaproperty.cpp
index 028d8c4..be2aede 100644
--- a/tests/auto/declarative/qdeclarativemetaproperty/tst_qdeclarativemetaproperty.cpp
+++ b/tests/auto/declarative/qdeclarativemetaproperty/tst_qdeclarativemetaproperty.cpp
@@ -42,6 +42,7 @@
#include <QtDeclarative/qdeclarativeengine.h>
#include <QtDeclarative/qdeclarativecomponent.h>
#include <QtDeclarative/qdeclarativemetaproperty.h>
+#include <QtDeclarative/private/qdeclarativemetaproperty_p.h>
#include <private/qguard_p.h>
#include <private/qdeclarativebinding_p.h>
#include <QtGui/QLineEdit>
@@ -160,11 +161,11 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty()
QCOMPARE(prop.propertyType(), 0);
QCOMPARE(prop.propertyTypeName(), (const char *)0);
QVERIFY(prop.property().name() == 0);
- QVERIFY(prop.binding() == 0);
- QVERIFY(prop.setBinding(binding) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0);
QVERIFY(binding == 0);
- QVERIFY(prop.signalExpression() == 0);
- QVERIFY(prop.setSignalExpression(expression) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0);
QVERIFY(expression == 0);
QCOMPARE(prop.coreIndex(), -1);
QCOMPARE(prop.valueTypeCoreIndex(), -1);
@@ -254,11 +255,11 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object()
QCOMPARE(prop.propertyType(), 0);
QCOMPARE(prop.propertyTypeName(), (const char *)0);
QVERIFY(prop.property().name() == 0);
- QVERIFY(prop.binding() == 0);
- QVERIFY(prop.setBinding(binding) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0);
QVERIFY(binding == 0);
- QVERIFY(prop.signalExpression() == 0);
- QVERIFY(prop.setSignalExpression(expression) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0);
QVERIFY(expression == 0);
QCOMPARE(prop.coreIndex(), -1);
QCOMPARE(prop.valueTypeCoreIndex(), -1);
@@ -301,13 +302,13 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object()
QCOMPARE(prop.propertyType(), (int)QVariant::Int);
QCOMPARE(prop.propertyTypeName(), "int");
QCOMPARE(QString(prop.property().name()), QString("defaultProperty"));
- QVERIFY(prop.binding() == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0);
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>:-1: Unable to assign null to int");
- QVERIFY(prop.setBinding(binding) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0);
QVERIFY(binding != 0);
- QVERIFY(prop.binding() == binding);
- QVERIFY(prop.signalExpression() == 0);
- QVERIFY(prop.setSignalExpression(expression) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == binding);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0);
QVERIFY(expression == 0);
QCOMPARE(prop.coreIndex(), dobject.metaObject()->indexOfProperty("defaultProperty"));
QCOMPARE(prop.valueTypeCoreIndex(), -1);
@@ -355,11 +356,11 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string()
QCOMPARE(prop.propertyType(), 0);
QCOMPARE(prop.propertyTypeName(), (const char *)0);
QVERIFY(prop.property().name() == 0);
- QVERIFY(prop.binding() == 0);
- QVERIFY(prop.setBinding(binding) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0);
QVERIFY(binding == 0);
- QVERIFY(prop.signalExpression() == 0);
- QVERIFY(prop.setSignalExpression(expression) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0);
QVERIFY(expression == 0);
QCOMPARE(prop.coreIndex(), -1);
QCOMPARE(prop.valueTypeCoreIndex(), -1);
@@ -402,13 +403,13 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string()
QCOMPARE(prop.propertyType(), (int)QVariant::Int);
QCOMPARE(prop.propertyTypeName(), "int");
QCOMPARE(QString(prop.property().name()), QString("defaultProperty"));
- QVERIFY(prop.binding() == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0);
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>:-1: Unable to assign null to int");
- QVERIFY(prop.setBinding(binding) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0);
QVERIFY(binding != 0);
- QVERIFY(prop.binding() == binding);
- QVERIFY(prop.signalExpression() == 0);
- QVERIFY(prop.setSignalExpression(expression) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == binding);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0);
QVERIFY(expression == 0);
QCOMPARE(prop.coreIndex(), dobject.metaObject()->indexOfProperty("defaultProperty"));
QCOMPARE(prop.valueTypeCoreIndex(), -1);
@@ -451,13 +452,13 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string()
QCOMPARE(prop.propertyType(), 0);
QCOMPARE(prop.propertyTypeName(), (const char *)0);
QCOMPARE(prop.property().name(), (const char *)0);
- QVERIFY(prop.binding() == 0);
- QVERIFY(prop.setBinding(binding) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0);
QVERIFY(binding == 0);
- QVERIFY(prop.signalExpression() == 0);
- QVERIFY(prop.setSignalExpression(expression) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0);
QVERIFY(expression != 0);
- QVERIFY(prop.signalExpression() == expression);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == expression);
QCOMPARE(prop.coreIndex(), dobject.metaObject()->indexOfMethod("clicked()"));
QCOMPARE(prop.valueTypeCoreIndex(), -1);
@@ -552,11 +553,11 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_context()
QCOMPARE(prop.propertyType(), 0);
QCOMPARE(prop.propertyTypeName(), (const char *)0);
QVERIFY(prop.property().name() == 0);
- QVERIFY(prop.binding() == 0);
- QVERIFY(prop.setBinding(binding) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0);
QVERIFY(binding == 0);
- QVERIFY(prop.signalExpression() == 0);
- QVERIFY(prop.setSignalExpression(expression) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0);
QVERIFY(expression == 0);
QCOMPARE(prop.coreIndex(), -1);
QCOMPARE(prop.valueTypeCoreIndex(), -1);
@@ -599,13 +600,13 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_context()
QCOMPARE(prop.propertyType(), (int)QVariant::Int);
QCOMPARE(prop.propertyTypeName(), "int");
QCOMPARE(QString(prop.property().name()), QString("defaultProperty"));
- QVERIFY(prop.binding() == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0);
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>:-1: Unable to assign null to int");
- QVERIFY(prop.setBinding(binding) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0);
QVERIFY(binding != 0);
- QVERIFY(prop.binding() == binding);
- QVERIFY(prop.signalExpression() == 0);
- QVERIFY(prop.setSignalExpression(expression) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == binding);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0);
QVERIFY(expression == 0);
QCOMPARE(prop.coreIndex(), dobject.metaObject()->indexOfProperty("defaultProperty"));
QCOMPARE(prop.valueTypeCoreIndex(), -1);
@@ -653,11 +654,11 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string_context()
QCOMPARE(prop.propertyType(), 0);
QCOMPARE(prop.propertyTypeName(), (const char *)0);
QVERIFY(prop.property().name() == 0);
- QVERIFY(prop.binding() == 0);
- QVERIFY(prop.setBinding(binding) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0);
QVERIFY(binding == 0);
- QVERIFY(prop.signalExpression() == 0);
- QVERIFY(prop.setSignalExpression(expression) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0);
QVERIFY(expression == 0);
QCOMPARE(prop.coreIndex(), -1);
QCOMPARE(prop.valueTypeCoreIndex(), -1);
@@ -700,13 +701,13 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string_context()
QCOMPARE(prop.propertyType(), (int)QVariant::Int);
QCOMPARE(prop.propertyTypeName(), "int");
QCOMPARE(QString(prop.property().name()), QString("defaultProperty"));
- QVERIFY(prop.binding() == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0);
QTest::ignoreMessage(QtWarningMsg, "<Unknown File>:-1: Unable to assign null to int");
- QVERIFY(prop.setBinding(binding) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0);
QVERIFY(binding != 0);
- QVERIFY(prop.binding() == binding);
- QVERIFY(prop.signalExpression() == 0);
- QVERIFY(prop.setSignalExpression(expression) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == binding);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0);
QVERIFY(expression == 0);
QCOMPARE(prop.coreIndex(), dobject.metaObject()->indexOfProperty("defaultProperty"));
QCOMPARE(prop.valueTypeCoreIndex(), -1);
@@ -749,13 +750,13 @@ void tst_qdeclarativemetaproperty::qmlmetaproperty_object_string_context()
QCOMPARE(prop.propertyType(), 0);
QCOMPARE(prop.propertyTypeName(), (const char *)0);
QCOMPARE(prop.property().name(), (const char *)0);
- QVERIFY(prop.binding() == 0);
- QVERIFY(prop.setBinding(binding) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::binding(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setBinding(prop, binding) == 0);
QVERIFY(binding == 0);
- QVERIFY(prop.signalExpression() == 0);
- QVERIFY(prop.setSignalExpression(expression) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == 0);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::setSignalExpression(prop, expression) == 0);
QVERIFY(expression != 0);
- QVERIFY(prop.signalExpression() == expression);
+ QVERIFY(QDeclarativeMetaPropertyPrivate::signalExpression(prop) == expression);
QCOMPARE(prop.coreIndex(), dobject.metaObject()->indexOfMethod("clicked()"));
QCOMPARE(prop.valueTypeCoreIndex(), -1);
@@ -867,19 +868,19 @@ void tst_qdeclarativemetaproperty::name()
{
PropertyObject o;
- QDeclarativeMetaProperty p = QDeclarativeMetaProperty::createProperty(&o, "rectProperty");
+ QDeclarativeMetaProperty p(&o, "rectProperty");
QCOMPARE(p.name(), QString("rectProperty"));
}
{
PropertyObject o;
- QDeclarativeMetaProperty p = QDeclarativeMetaProperty::createProperty(&o, "rectProperty.x");
+ QDeclarativeMetaProperty p(&o, "rectProperty.x");
QCOMPARE(p.name(), QString("rectProperty.x"));
}
{
PropertyObject o;
- QDeclarativeMetaProperty p = QDeclarativeMetaProperty::createProperty(&o, "rectProperty.foo");
+ QDeclarativeMetaProperty p(&o, "rectProperty.foo");
QCOMPARE(p.name(), QString());
}
}
@@ -921,14 +922,14 @@ void tst_qdeclarativemetaproperty::read()
// Value-type prop
{
PropertyObject o;
- QDeclarativeMetaProperty p = QDeclarativeMetaProperty::createProperty(&o, "rectProperty.x");
+ QDeclarativeMetaProperty p(&o, "rectProperty.x");
QCOMPARE(p.read(), QVariant(10));
}
// Invalid value-type prop
{
PropertyObject o;
- QDeclarativeMetaProperty p = QDeclarativeMetaProperty::createProperty(&o, "rectProperty.foo");
+ QDeclarativeMetaProperty p(&o, "rectProperty.foo");
QCOMPARE(p.read(), QVariant());
}
@@ -938,8 +939,8 @@ void tst_qdeclarativemetaproperty::read()
QDeclarativeMetaProperty p(&o, "onClicked");
QCOMPARE(p.read(), QVariant());
- QVERIFY(0 == p.setSignalExpression(new QDeclarativeExpression()));
- QVERIFY(0 != p.signalExpression());
+ QVERIFY(0 == QDeclarativeMetaPropertyPrivate::setSignalExpression(p, new QDeclarativeExpression()));
+ QVERIFY(0 != QDeclarativeMetaPropertyPrivate::signalExpression(p));
QCOMPARE(p.read(), QVariant());
}
@@ -959,7 +960,7 @@ void tst_qdeclarativemetaproperty::read()
// Deleted object
{
PropertyObject *o = new PropertyObject;
- QDeclarativeMetaProperty p = QDeclarativeMetaProperty::createProperty(o, "rectProperty.x");
+ QDeclarativeMetaProperty p(o, "rectProperty.x");
QCOMPARE(p.read(), QVariant(10));
delete o;
QCOMPARE(p.read(), QVariant());
@@ -972,7 +973,7 @@ void tst_qdeclarativemetaproperty::read()
QObject *object = component.create();
QVERIFY(object != 0);
- QDeclarativeMetaProperty p = QDeclarativeMetaProperty::createProperty(object, "MyContainer.foo", qmlContext(object));
+ QDeclarativeMetaProperty p(object, "MyContainer.foo", qmlContext(object));
QCOMPARE(p.read(), QVariant(13));
delete object;
}
@@ -982,7 +983,7 @@ void tst_qdeclarativemetaproperty::read()
QObject *object = component.create();
QVERIFY(object != 0);
- QDeclarativeMetaProperty p = QDeclarativeMetaProperty::createProperty(object, "MyContainer.foo", qmlContext(object));
+ QDeclarativeMetaProperty p(object, "MyContainer.foo", qmlContext(object));
QCOMPARE(p.read(), QVariant(10));
delete object;
}
@@ -992,7 +993,7 @@ void tst_qdeclarativemetaproperty::read()
QObject *object = component.create();
QVERIFY(object != 0);
- QDeclarativeMetaProperty p = QDeclarativeMetaProperty::createProperty(object, "Foo.MyContainer.foo", qmlContext(object));
+ QDeclarativeMetaProperty p(object, "Foo.MyContainer.foo", qmlContext(object));
QCOMPARE(p.read(), QVariant(10));
delete object;
}
@@ -1054,12 +1055,12 @@ void tst_qdeclarativemetaproperty::write()
QDeclarativeMetaProperty p(&o, "onClicked");
QCOMPARE(p.write(QVariant("console.log(1921)")), false);
- QVERIFY(0 == p.setSignalExpression(new QDeclarativeExpression()));
- QVERIFY(0 != p.signalExpression());
+ QVERIFY(0 == QDeclarativeMetaPropertyPrivate::setSignalExpression(p, new QDeclarativeExpression()));
+ QVERIFY(0 != QDeclarativeMetaPropertyPrivate::signalExpression(p));
QCOMPARE(p.write(QVariant("console.log(1921)")), false);
- QVERIFY(0 != p.signalExpression());
+ QVERIFY(0 != QDeclarativeMetaPropertyPrivate::signalExpression(p));
}
// Automatic signal property
@@ -1085,7 +1086,7 @@ void tst_qdeclarativemetaproperty::write()
QCOMPARE(p.write(QRect(1, 13, 99, 8)), true);
QCOMPARE(o.wrectProperty(), QRect(1, 13, 99, 8));
- QDeclarativeMetaProperty p2 = QDeclarativeMetaProperty::createProperty(&o, "wrectProperty.x");
+ QDeclarativeMetaProperty p2(&o, "wrectProperty.x");
QCOMPARE(p2.read(), QVariant(1));
QCOMPARE(p2.write(QVariant(6)), true);
QCOMPARE(p2.read(), QVariant(6));
@@ -1116,7 +1117,7 @@ void tst_qdeclarativemetaproperty::write()
QObject *object = component.create();
QVERIFY(object != 0);
- QDeclarativeMetaProperty p = QDeclarativeMetaProperty::createProperty(object, "MyContainer.foo", qmlContext(object));
+ QDeclarativeMetaProperty p(object, "MyContainer.foo", qmlContext(object));
p.write(QVariant(99));
QCOMPARE(p.read(), QVariant(99));
delete object;
@@ -1127,7 +1128,7 @@ void tst_qdeclarativemetaproperty::write()
QObject *object = component.create();
QVERIFY(object != 0);
- QDeclarativeMetaProperty p = QDeclarativeMetaProperty::createProperty(object, "Foo.MyContainer.foo", qmlContext(object));
+ QDeclarativeMetaProperty p(object, "Foo.MyContainer.foo", qmlContext(object));
p.write(QVariant(99));
QCOMPARE(p.read(), QVariant(99));
delete object;
@@ -1264,7 +1265,7 @@ void tst_qdeclarativemetaproperty::crashOnValueProperty()
PropertyObject *obj = qobject_cast<PropertyObject*>(component.create());
QVERIFY(obj != 0);
- QDeclarativeMetaProperty p = QDeclarativeMetaProperty::createProperty(obj, "wrectProperty.x", qmlContext(obj));
+ QDeclarativeMetaProperty p(obj, "wrectProperty.x", qmlContext(obj));
QCOMPARE(p.name(), QString("wrectProperty.x"));
QCOMPARE(p.read(), QVariant(10));
diff --git a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp
index ca16214..4333e02 100644
--- a/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp
+++ b/tests/auto/declarative/qdeclarativemetatype/tst_qdeclarativemetatype.cpp
@@ -40,7 +40,6 @@
****************************************************************************/
#include <qtest.h>
-#include <QDeclarativeMetaType>
#include <QLocale>
#include <QPixmap>
#include <QBitmap>
@@ -53,6 +52,8 @@
#include <QQuaternion>
#include <qdeclarative.h>
+#include <private/qdeclarativemetatype_p.h>
+
class tst_qdeclarativemetatype : public QObject
{
Q_OBJECT
diff --git a/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp
index 6433791..154693c 100644
--- a/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp
+++ b/tests/auto/declarative/qdeclarativemoduleplugin/plugin/plugin.cpp
@@ -38,6 +38,7 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+#include <QStringList>
#include <QtDeclarative/qdeclarativeextensionplugin.h>
#include <QtDeclarative/qdeclarative.h>
#include <QDebug>
diff --git a/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h
index c4a9187..8b80e16 100644
--- a/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h
+++ b/tests/auto/declarative/qdeclarativevaluetypes/testtypes.h
@@ -52,6 +52,7 @@
#include <QFont>
#include <qdeclarative.h>
#include <QDeclarativePropertyValueSource>
+#include <QDeclarativeMetaProperty>
class MyTypeObject : public QObject
{