diff options
Diffstat (limited to 'tests/auto/declarative/qdeclarativeecmascript/data/aliasreset/aliasPropertyReset.3.qml')
-rw-r--r-- | tests/auto/declarative/qdeclarativeecmascript/data/aliasreset/aliasPropertyReset.3.qml | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/auto/declarative/qdeclarativeecmascript/data/aliasreset/aliasPropertyReset.3.qml b/tests/auto/declarative/qdeclarativeecmascript/data/aliasreset/aliasPropertyReset.3.qml new file mode 100644 index 0000000000..4fa6861b08 --- /dev/null +++ b/tests/auto/declarative/qdeclarativeecmascript/data/aliasreset/aliasPropertyReset.3.qml @@ -0,0 +1,31 @@ +import QtQuick 1.0 +import Qt.test 1.0 + +Item { + id: first + property bool loaderTwoSourceComponentIsUndefined: false + property bool loaderOneSourceComponentIsUndefined: false + property alias sourceComponentAlias: loaderOne.sourceComponent + + Component { + id: redSquare + Rectangle { color: "red"; width: 10; height: 10 } + } + + Loader { + id: loaderOne + sourceComponent: loaderTwo.sourceComponent + } + + Loader { + id: loaderTwo + sourceComponent: redSquare + x: 15 + } + + function resetAlias() { + sourceComponentAlias = undefined; // loaderOne.sourceComponent should be set to undefined instead of l2.sc + loaderOneSourceComponentIsUndefined = (loaderOne.sourceComponent == undefined); // should be true + loaderTwoSourceComponentIsUndefined = (loaderTwo.sourceComponent == undefined); // should be false + } +} |