aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-02-28 13:04:16 +0100
committerLiang Qi <liang.qi@qt.io>2017-02-28 13:04:17 +0100
commitafec9016d0fd51345ea93a1bbadb99b5c3fdf629 (patch)
tree39aa0d02457c643065fbfb298645b2f3877c92bb /tests
parentbb1acc24587ebdecc4051ef4b573ef32cfb8a8c5 (diff)
parentba68c325688acf3072715757480497524f61c425 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qml/qqmlecmascript/testtypes.cpp2
-rw-r--r--tests/auto/qml/qqmlecmascript/testtypes.h8
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp44
-rw-r--r--tests/auto/qml/qqmllanguage/testtypes.cpp4
-rw-r--r--tests/auto/qml/qqmllanguage/testtypes.h54
-rw-r--r--tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp59
-rw-r--r--tests/auto/qml/qqmllistreference/data/propertyList.qml12
-rw-r--r--tests/auto/qml/qqmllistreference/qqmllistreference.pro2
-rw-r--r--tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp24
-rw-r--r--tests/auto/quick/qquickitem/tst_qquickitem.cpp26
-rw-r--r--tests/auto/quick/qquicklayouts/data/rowlayout/Container2.qml55
-rw-r--r--tests/auto/quick/qquicklayouts/data/rowlayout/ContainerUser2.qml46
-rw-r--r--tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml10
13 files changed, 340 insertions, 6 deletions
diff --git a/tests/auto/qml/qqmlecmascript/testtypes.cpp b/tests/auto/qml/qqmlecmascript/testtypes.cpp
index d9ddcd71a7..63c2918325 100644
--- a/tests/auto/qml/qqmlecmascript/testtypes.cpp
+++ b/tests/auto/qml/qqmlecmascript/testtypes.cpp
@@ -515,6 +515,8 @@ void registerTypes()
qmlRegisterType<QObjectContainer>("Qt.test", 1, 0, "QObjectContainer");
qmlRegisterType<QObjectContainerWithGCOnAppend>("Qt.test", 1, 0, "QObjectContainerWithGCOnAppend");
qmlRegisterType<FloatingQObject>("Qt.test", 1, 0, "FloatingQObject");
+
+ qmlRegisterType<ClashingNames>("Qt.test", 1, 0, "ClashingNames");
}
#include "testtypes.moc"
diff --git a/tests/auto/qml/qqmlecmascript/testtypes.h b/tests/auto/qml/qqmlecmascript/testtypes.h
index 1f7f3344ef..eedeb66647 100644
--- a/tests/auto/qml/qqmlecmascript/testtypes.h
+++ b/tests/auto/qml/qqmlecmascript/testtypes.h
@@ -1714,6 +1714,14 @@ public:
virtual void componentComplete();
};
+class ClashingNames : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(bool clashes READ clashes CONSTANT)
+public:
+ Q_INVOKABLE bool clashes() const { return true; }
+};
+
void registerTypes();
#endif // TESTTYPES_H
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 44582817d5..91ceed7697 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -47,6 +47,7 @@
#include <private/qv4runtime_p.h>
#include <private/qv4object_p.h>
#include <private/qqmlcomponentattached_p.h>
+#include <private/qv4objectiterator_p.h>
#ifdef Q_CC_MSVC
#define NO_INLINE __declspec(noinline)
@@ -261,6 +262,7 @@ private slots:
void nonNotifyable();
void deleteWhileBindingRunning();
void callQtInvokables();
+ void resolveClashingProperties();
void invokableObjectArg();
void invokableObjectRet();
void invokableEnumRet();
@@ -2991,6 +2993,48 @@ void tst_qqmlecmascript::callQtInvokables()
QVERIFY(callback.isCallable());
}
+void tst_qqmlecmascript::resolveClashingProperties()
+{
+ ClashingNames *o = new ClashingNames();
+ QQmlEngine qmlengine;
+ QQmlEnginePrivate *ep = QQmlEnginePrivate::get(&qmlengine);
+
+ QV4::ExecutionEngine *engine = QV8Engine::getV4(ep->v8engine());
+ QV4::Scope scope(engine);
+
+ QV4::ScopedValue object(scope, QV4::QObjectWrapper::wrap(engine, o));
+ QV4::ObjectIterator it(scope, object->as<QV4::Object>(), QV4::ObjectIterator::EnumerableOnly);
+ QV4::ScopedValue name(scope);
+ QV4::ScopedValue value(scope);
+
+ bool seenProperty = false;
+ bool seenMethod = false;
+ while (true) {
+ QV4::Value v;
+ name = it.nextPropertyNameAsString(&v);
+ if (name->isNull())
+ break;
+ QString key = name->toQStringNoThrow();
+ if (key == QLatin1String("clashes")) {
+ value = v;
+ QV4::ScopedValue typeString(scope, QV4::Runtime::method_typeofValue(engine, value));
+ QString type = typeString->toQStringNoThrow();
+ if (type == QLatin1String("boolean")) {
+ QVERIFY(!seenProperty);
+ seenProperty = true;
+ } else if (type == QLatin1String("function")) {
+ QVERIFY(!seenMethod);
+ seenMethod = true;
+ } else {
+ QFAIL(qPrintable(QString::fromLatin1("found 'clashes' property of type %1")
+ .arg(type)));
+ }
+ }
+ }
+ QVERIFY(seenProperty);
+ QVERIFY(seenMethod);
+}
+
// QTBUG-13047 (check that you can pass registered object types as args)
void tst_qqmlecmascript::invokableObjectArg()
{
diff --git a/tests/auto/qml/qqmllanguage/testtypes.cpp b/tests/auto/qml/qqmllanguage/testtypes.cpp
index bc8c192a61..bdcdaa8137 100644
--- a/tests/auto/qml/qqmllanguage/testtypes.cpp
+++ b/tests/auto/qml/qqmllanguage/testtypes.cpp
@@ -87,6 +87,10 @@ void registerTypes()
qmlRegisterUncreatableType<MyUncreateableBaseClass,1>("Test", 1, 1, "MyUncreateableBaseClass", "Cannot create MyUncreateableBaseClass");
qmlRegisterType<MyCreateableDerivedClass,1>("Test", 1, 1, "MyCreateableDerivedClass");
+ qmlRegisterExtendedUncreatableType<MyExtendedUncreateableBaseClass, MyExtendedUncreateableBaseClassExtension>("Test", 1, 0, "MyExtendedUncreateableBaseClass", "Cannot create MyExtendedUncreateableBaseClass");
+ qmlRegisterExtendedUncreatableType<MyExtendedUncreateableBaseClass, MyExtendedUncreateableBaseClassExtension, 1>("Test", 1, 1, "MyExtendedUncreateableBaseClass", "Cannot create MyExtendedUncreateableBaseClass");
+ qmlRegisterType<MyExtendedCreateableDerivedClass>("Test", 1, 0, "MyExtendedCreateableDerivedClass");
+
qmlRegisterCustomType<CustomBinding>("Test", 1, 0, "CustomBinding", new CustomBindingParser);
qmlRegisterCustomType<SimpleObjectWithCustomParser>("Test", 1, 0, "SimpleObjectWithCustomParser", new SimpleObjectCustomParser);
diff --git a/tests/auto/qml/qqmllanguage/testtypes.h b/tests/auto/qml/qqmllanguage/testtypes.h
index 6c62bcf7b9..7d7a8ac6d3 100644
--- a/tests/auto/qml/qqmllanguage/testtypes.h
+++ b/tests/auto/qml/qqmllanguage/testtypes.h
@@ -1021,6 +1021,60 @@ public:
}
};
+class MyExtendedUncreateableBaseClass : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(bool prop1 READ prop1 WRITE setprop1)
+ Q_PROPERTY(bool prop2 READ prop2 WRITE setprop2 REVISION 1)
+ Q_PROPERTY(bool prop3 READ prop3 WRITE setprop3 REVISION 1)
+public:
+ explicit MyExtendedUncreateableBaseClass(QObject *parent = 0)
+ : QObject(parent), _prop1(false), _prop2(false), _prop3(false)
+ {
+ }
+
+ bool _prop1;
+ bool prop1() const { return _prop1; }
+ void setprop1(bool p) { _prop1 = p; }
+ bool _prop2;
+ bool prop2() const { return _prop2; }
+ void setprop2(bool p) { _prop2 = p; }
+ bool _prop3;
+ bool prop3() const { return _prop3; }
+ void setprop3(bool p) { _prop3 = p; }
+};
+
+class MyExtendedUncreateableBaseClassExtension : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(bool prop4 READ prop4 WRITE setprop4)
+public:
+ explicit MyExtendedUncreateableBaseClassExtension(QObject *parent = 0)
+ : QObject(parent), _prop4(false)
+ {
+ }
+
+ bool _prop4;
+ bool prop4() const { return _prop4; }
+ void setprop4(bool p) { _prop4 = p; }
+};
+
+class MyExtendedCreateableDerivedClass : public MyExtendedUncreateableBaseClass
+{
+ Q_OBJECT
+ Q_PROPERTY(bool prop5 READ prop5 WRITE setprop5)
+
+public:
+ MyExtendedCreateableDerivedClass(QObject *parent = 0)
+ : MyExtendedUncreateableBaseClass(parent), _prop5(false)
+ {
+ }
+
+ bool _prop5;
+ bool prop5() const { return _prop5; }
+ void setprop5(bool p) { _prop5 = p; }
+};
+
class MyVersion2Class : public QObject
{
Q_OBJECT
diff --git a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
index c0500afddd..750c32cc3c 100644
--- a/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
+++ b/tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp
@@ -189,6 +189,9 @@ private slots:
void subclassedUncreateableRevision_data();
void subclassedUncreateableRevision();
+ void subclassedExtendedUncreateableRevision_data();
+ void subclassedExtendedUncreateableRevision();
+
void uncreatableTypesAsProperties();
void propertyInit();
@@ -3228,6 +3231,62 @@ void tst_qqmllanguage::subclassedUncreateableRevision()
delete obj;
}
+void tst_qqmllanguage::subclassedExtendedUncreateableRevision_data()
+{
+ QTest::addColumn<QString>("version");
+ QTest::addColumn<QString>("prop");
+ QTest::addColumn<bool>("shouldWork");
+
+ QTest::newRow("prop1 exists in 1.0") << "1.0" << "prop1" << true;
+ QTest::newRow("prop2 does not exist in 1.0") << "1.0" << "prop2" << false;
+ QTest::newRow("prop3 does not exist in 1.0") << "1.0" << "prop3" << false;
+ QTest::newRow("prop4 exists in 1.0") << "1.0" << "prop4" << true;
+ QTest::newRow("prop5 exists in 1.0") << "1.0" << "prop5" << true;
+
+ QTest::newRow("prop1 exists in 1.1") << "1.1" << "prop1" << true;
+ QTest::newRow("prop2 exists in 1.1") << "1.1" << "prop2" << true;
+ QTest::newRow("prop3 exists in 1.1") << "1.1" << "prop3" << true;
+ QTest::newRow("prop4 exists in 1.1") << "1.1" << "prop4" << true;
+ QTest::newRow("prop5 exists in 1.1") << "1.1" << "prop5" << true;
+}
+
+void tst_qqmllanguage::subclassedExtendedUncreateableRevision()
+{
+ QFETCH(QString, version);
+ QFETCH(QString, prop);
+ QFETCH(bool, shouldWork);
+
+ {
+ QQmlEngine engine;
+ QString qml = QString("import QtQuick 2.0\nimport Test %1\nMyExtendedUncreateableBaseClass {}").arg(version);
+ QQmlComponent c(&engine);
+ QTest::ignoreMessage(QtWarningMsg, "QQmlComponent: Component is not ready");
+ c.setData(qml.toUtf8(), QUrl::fromLocalFile(QDir::currentPath()));
+ QObject *obj = c.create();
+ QCOMPARE(obj, static_cast<QObject*>(0));
+ QCOMPARE(c.errors().count(), 1);
+ QCOMPARE(c.errors().first().description(), QString("Cannot create MyExtendedUncreateableBaseClass"));
+ }
+
+ QQmlEngine engine;
+ QString qml = QString("import QtQuick 2.0\nimport Test %1\nMyExtendedCreateableDerivedClass {\n%3: true\n}").arg(version).arg(prop);
+ QQmlComponent c(&engine);
+ if (!shouldWork)
+ QTest::ignoreMessage(QtWarningMsg, "QQmlComponent: Component is not ready");
+ c.setData(qml.toUtf8(), QUrl::fromLocalFile(QDir::currentPath()));
+ QObject *obj = c.create();
+ if (!shouldWork) {
+ QCOMPARE(obj, static_cast<QObject*>(0));
+ return;
+ }
+
+ QVERIFY(obj);
+ MyExtendedUncreateableBaseClass *base = qobject_cast<MyExtendedUncreateableBaseClass*>(obj);
+ QVERIFY(base);
+ QCOMPARE(base->property(prop.toLatin1()).toBool(), true);
+ delete obj;
+}
+
void tst_qqmllanguage::uncreatableTypesAsProperties()
{
QQmlEngine engine;
diff --git a/tests/auto/qml/qqmllistreference/data/propertyList.qml b/tests/auto/qml/qqmllistreference/data/propertyList.qml
new file mode 100644
index 0000000000..c791c6dcf0
--- /dev/null
+++ b/tests/auto/qml/qqmllistreference/data/propertyList.qml
@@ -0,0 +1,12 @@
+import QtQuick 2.7
+
+Item {
+ id:root
+
+ Component.onCompleted : {
+ var st1 = Qt.createQmlObject( "import QtQuick 2.7; State{ name: 'MyState1' }", root, "dynamicState1" );
+ var st2 = Qt.createQmlObject( "import QtQuick 2.7; State{ name: 'MyState2' }", root, "dynamicState2" );
+ root.states.push( st1, st2 );
+ root.state = "MyState2";
+ }
+}
diff --git a/tests/auto/qml/qqmllistreference/qqmllistreference.pro b/tests/auto/qml/qqmllistreference/qqmllistreference.pro
index dceb7d1133..110d0d9c81 100644
--- a/tests/auto/qml/qqmllistreference/qqmllistreference.pro
+++ b/tests/auto/qml/qqmllistreference/qqmllistreference.pro
@@ -8,4 +8,4 @@ include (../../shared/util.pri)
TESTDATA = data/*
-QT += core-private gui-private qml-private testlib
+QT += core-private gui-private quick-private qml-private testlib
diff --git a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
index 4d33359eaa..5c16a48378 100644
--- a/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
+++ b/tests/auto/qml/qqmllistreference/tst_qqmllistreference.cpp
@@ -36,6 +36,7 @@
#include <QtQml/qqmlprivate.h>
#include <QtQml/qqmlproperty.h>
#include <QDebug>
+#include <private/qquickstate_p.h>
#include "../../shared/util.h"
class tst_qqmllistreference : public QQmlDataTest
@@ -65,6 +66,7 @@ private slots:
void qmlmetaproperty();
void engineTypes();
void variantToList();
+ void listProperty();
};
class TestType : public QObject
@@ -618,6 +620,28 @@ void tst_qqmllistreference::variantToList()
delete o;
}
+void tst_qqmllistreference::listProperty()
+{
+ QQmlEngine engine;
+ QQmlComponent component(&engine, testFileUrl("propertyList.qml"));
+
+ QScopedPointer<QObject> object( component.create() );
+ QVERIFY(object != 0);
+
+ QCOMPARE( object->property("state").toString(), QStringLiteral("MyState2") );
+ QQmlListReference list( object.data(), "states");
+ QCOMPARE( list.count(), 2 );
+
+ QQuickState* state1 = dynamic_cast<QQuickState*>( list.at( 0 ) );
+ QVERIFY(state1 != 0);
+ QCOMPARE( state1->name(), QStringLiteral("MyState1") );
+ QQuickState* state2 = dynamic_cast<QQuickState*>( list.at( 1 ) );
+ QVERIFY(state2 != 0);
+
+ QCOMPARE( state2->name(), QStringLiteral("MyState2") );
+}
+
+
QTEST_MAIN(tst_qqmllistreference)
#include "tst_qqmllistreference.moc"
diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
index 8d974f4d17..10a3a0bfa8 100644
--- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
@@ -48,7 +48,8 @@ public:
TestItem(QQuickItem *parent = 0)
: QQuickItem(parent), focused(false), pressCount(0), releaseCount(0)
, wheelCount(0), acceptIncomingTouchEvents(true)
- , touchEventReached(false), timestamp(0) {}
+ , touchEventReached(false), timestamp(0)
+ , lastWheelEventPos(0, 0), lastWheelEventGlobalPos(0, 0) {}
bool focused;
int pressCount;
@@ -57,6 +58,8 @@ public:
bool acceptIncomingTouchEvents;
bool touchEventReached;
ulong timestamp;
+ QPoint lastWheelEventPos;
+ QPoint lastWheelEventGlobalPos;
protected:
virtual void focusInEvent(QFocusEvent *) { Q_ASSERT(!focused); focused = true; }
virtual void focusOutEvent(QFocusEvent *) { Q_ASSERT(focused); focused = false; }
@@ -66,7 +69,13 @@ protected:
touchEventReached = true;
event->setAccepted(acceptIncomingTouchEvents);
}
- virtual void wheelEvent(QWheelEvent *event) { event->accept(); ++wheelCount; timestamp = event->timestamp(); }
+ virtual void wheelEvent(QWheelEvent *event) {
+ event->accept();
+ ++wheelCount;
+ timestamp = event->timestamp();
+ lastWheelEventPos = event->pos();
+ lastWheelEventGlobalPos = event->globalPos();
+ }
};
class TestWindow: public QQuickWindow
@@ -1422,19 +1431,24 @@ void tst_qquickitem::wheelEvent()
const bool shouldReceiveWheelEvents = visible && enabled;
+ const int width = 200;
+ const int height = 200;
+
QQuickWindow window;
- window.resize(200, 200);
+ window.resize(width, height);
window.show();
QTest::qWaitForWindowExposed(&window);
TestItem *item = new TestItem;
- item->setSize(QSizeF(200, 100));
+ item->setSize(QSizeF(width, height));
item->setParentItem(window.contentItem());
item->setEnabled(enabled);
item->setVisible(visible);
- QWheelEvent event(QPoint(100, 50), -120, Qt::NoButton, Qt::NoModifier, Qt::Vertical);
+ QPoint localPoint(width / 2, height / 2);
+ QPoint globalPoint = window.mapToGlobal(localPoint);
+ QWheelEvent event(localPoint, globalPoint, -120, Qt::NoButton, Qt::NoModifier, Qt::Vertical);
event.setTimestamp(123456UL);
event.setAccepted(false);
QGuiApplication::sendEvent(&window, &event);
@@ -1443,6 +1457,8 @@ void tst_qquickitem::wheelEvent()
QVERIFY(event.isAccepted());
QCOMPARE(item->wheelCount, 1);
QCOMPARE(item->timestamp, 123456UL);
+ QCOMPARE(item->lastWheelEventPos, localPoint);
+ QCOMPARE(item->lastWheelEventGlobalPos, globalPoint);
} else {
QVERIFY(!event.isAccepted());
QCOMPARE(item->wheelCount, 0);
diff --git a/tests/auto/quick/qquicklayouts/data/rowlayout/Container2.qml b/tests/auto/quick/qquicklayouts/data/rowlayout/Container2.qml
new file mode 100644
index 0000000000..248652e82b
--- /dev/null
+++ b/tests/auto/quick/qquicklayouts/data/rowlayout/Container2.qml
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.9
+import QtQuick.Layouts 1.3
+
+Item {
+ objectName: "qtbug51927-container"
+ visible: true
+
+ default property alias _contents: customContent.data
+
+ ColumnLayout {
+ id: customContent
+ objectName: "qtbug51927-columnLayout"
+ anchors.fill: parent
+ }
+}
diff --git a/tests/auto/quick/qquicklayouts/data/rowlayout/ContainerUser2.qml b/tests/auto/quick/qquicklayouts/data/rowlayout/ContainerUser2.qml
new file mode 100644
index 0000000000..9def782d4a
--- /dev/null
+++ b/tests/auto/quick/qquicklayouts/data/rowlayout/ContainerUser2.qml
@@ -0,0 +1,46 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: http://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.6
+
+Container2 {
+ visible: true
+ Item {}
+}
diff --git a/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml b/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml
index 97860458fe..4346c5283e 100644
--- a/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml
+++ b/tests/auto/quick/qquicklayouts/data/tst_rowlayout.qml
@@ -959,5 +959,15 @@ Item {
// Shouldn't crash.
containerUser.destroy();
}
+
+ function test_defaultPropertyAliasCrashAgain() {
+ var containerUserComponent = Qt.createComponent("rowlayout/ContainerUser2.qml");
+ compare(containerUserComponent.status, Component.Ready);
+
+ var containerUser = createTemporaryObject(containerUserComponent, testCase);
+ verify(containerUser);
+
+ // Shouldn't crash upon destroying containerUser.
+ }
}
}