Forward port auto test for fix in QtQuick1
This is the auto-test part of https://codereview.qt-project.org/#change,61117 The test passes as-is but we should forward the fix to ensure that we don't regress. Change-Id: Ief8fcfc29d671f33cd1b2c3bab7acfd4fcd1df2b Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
This commit is contained in:
parent
184cf0e8f8
commit
3a67542e06
|
|
@ -0,0 +1,7 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
Item {
|
||||||
|
property alias someObject: text
|
||||||
|
Text {
|
||||||
|
id: text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
import QtQuick 2.0
|
||||||
|
DeepComponent {
|
||||||
|
someObject.font.family: "test"
|
||||||
|
}
|
||||||
|
|
@ -48,6 +48,7 @@
|
||||||
#include <QtCore/qfileinfo.h>
|
#include <QtCore/qfileinfo.h>
|
||||||
#include <QtCore/qdir.h>
|
#include <QtCore/qdir.h>
|
||||||
#include <QSignalSpy>
|
#include <QSignalSpy>
|
||||||
|
#include <QFont>
|
||||||
|
|
||||||
#include <private/qqmlproperty_p.h>
|
#include <private/qqmlproperty_p.h>
|
||||||
#include <private/qqmlmetatype_p.h>
|
#include <private/qqmlmetatype_p.h>
|
||||||
|
|
@ -190,6 +191,8 @@ private slots:
|
||||||
|
|
||||||
void scopedProperties();
|
void scopedProperties();
|
||||||
|
|
||||||
|
void deepProperty();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QQmlEngine engine;
|
QQmlEngine engine;
|
||||||
QStringList defaultImportPathList;
|
QStringList defaultImportPathList;
|
||||||
|
|
@ -3150,6 +3153,15 @@ void tst_qqmllanguage::scopedProperties()
|
||||||
QVERIFY(o->property("success").toBool());
|
QVERIFY(o->property("success").toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void tst_qqmllanguage::deepProperty()
|
||||||
|
{
|
||||||
|
QQmlComponent component(&engine, testFile("deepProperty.qml"));
|
||||||
|
QScopedPointer<QObject> o(component.create());
|
||||||
|
QVERIFY(o != 0);
|
||||||
|
QFont font = qvariant_cast<QFont>(qvariant_cast<QObject*>(o->property("someObject"))->property("font"));
|
||||||
|
QCOMPARE(font.family(), QStringLiteral("test"));
|
||||||
|
}
|
||||||
|
|
||||||
// Tests that the implicit import has lowest precedence, in the case where
|
// Tests that the implicit import has lowest precedence, in the case where
|
||||||
// there are conflicting types and types only found in the local import.
|
// there are conflicting types and types only found in the local import.
|
||||||
// Tests that just check one (or the root) type are in ::importsOrder
|
// Tests that just check one (or the root) type are in ::importsOrder
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue