aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/v4/tst_v4.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/v4/tst_v4.cpp')
-rw-r--r--tests/auto/qml/v4/tst_v4.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qml/v4/tst_v4.cpp b/tests/auto/qml/v4/tst_v4.cpp
index 559abf7388..4e3e71f717 100644
--- a/tests/auto/qml/v4/tst_v4.cpp
+++ b/tests/auto/qml/v4/tst_v4.cpp
@@ -45,6 +45,7 @@
#include <QtQml/qqmlengine.h>
#include <QtQml/qqmlcomponent.h>
#include <QtCore/qdebug.h>
+#include <QtGui/qcolor.h>
#include <private/qv4compiler_p.h>
@@ -73,6 +74,7 @@ private slots:
void stringComparison();
void unaryMinus();
void unaryPlus();
+ void colorType();
private:
QQmlEngine engine;
@@ -348,6 +350,22 @@ void tst_v4::unaryPlus()
delete o;
}
+void tst_v4::colorType()
+{
+ QQmlComponent component(&engine, testFileUrl("colorType.qml"));
+
+ QObject *o = component.create();
+ QVERIFY(o != 0);
+ QCOMPARE(o->property("test1").value<QColor>(), QColor("red"));
+ QCOMPARE(o->property("test2").value<QColor>(), QColor("red"));
+ QCOMPARE(o->property("test3").value<QColor>(), QColor("red"));
+ QCOMPARE(o->property("test4").toBool(), true);
+ QCOMPARE(o->property("test5").toBool(), true);
+ QCOMPARE(o->property("test6").toBool(), true);
+ QCOMPARE(o->property("test7").toBool(), true);
+ delete o;
+}
+
QTEST_MAIN(tst_v4)
#include "tst_v4.moc"