From 9730574818c80b956946dc26458c839915855196 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 27 Oct 2015 12:21:00 +0100 Subject: QML: Fix typeof context property. This was missing from f21e8c641af6b2d10f0d7e7e0fc6a755dab3673c. Task-number: QTBUG-48524 Change-Id: I5cc6a979d965a1ef6b7fbc916a7ca9df868b459a Reviewed-by: Simon Hausmann --- tests/auto/qml/qqmlengine/data/TypeofQmlProperty.qml | 6 ++++++ tests/auto/qml/qqmlengine/tst_qqmlengine.cpp | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 tests/auto/qml/qqmlengine/data/TypeofQmlProperty.qml (limited to 'tests/auto/qml/qqmlengine') diff --git a/tests/auto/qml/qqmlengine/data/TypeofQmlProperty.qml b/tests/auto/qml/qqmlengine/data/TypeofQmlProperty.qml new file mode 100644 index 0000000000..2196543dc8 --- /dev/null +++ b/tests/auto/qml/qqmlengine/data/TypeofQmlProperty.qml @@ -0,0 +1,6 @@ +import QtQuick 2.5 + +Item { + property var someProp: 1 + Component.onCompleted: console.log("typeof someProp:", typeof(someProp)); +} diff --git a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp index cb911d0115..486a0b4e87 100644 --- a/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp +++ b/tests/auto/qml/qqmlengine/tst_qqmlengine.cpp @@ -75,6 +75,8 @@ private slots: void urlInterceptor_data(); void urlInterceptor(); + void qmlContextProperties(); + public slots: QObject *createAQObjectForOwnershipTest () { @@ -778,6 +780,18 @@ void tst_qqmlengine::urlInterceptor() QCOMPARE(o->property("absoluteUrl").toString(), expectedAbsoluteUrl); } +void tst_qqmlengine::qmlContextProperties() +{ + QQmlEngine e; + + QQmlComponent c(&e, testFileUrl("TypeofQmlProperty.qml")); + QObject *o = c.create(); + if (!o) { + qDebug() << c.errorString(); + } + QVERIFY(o); +} + QTEST_MAIN(tst_qqmlengine) #include "tst_qqmlengine.moc" -- cgit v1.2.3