aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickbehaviors
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2019-06-27 10:34:45 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-06-27 09:36:10 +0000
commit732b63ed0cd38feebd17978abde2843eddd2b7b2 (patch)
tree3b127067b730db6858945b6177d3411680cd851b /tests/auto/quick/qquickbehaviors
parent9834ac56049408fbd848e364a82aabddc0815a07 (diff)
Check that animation still exists
Fixes: QTBUG-76749 Change-Id: Ie5eed240e8190a7297f71f5e40870a007e737d1d Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickbehaviors')
-rw-r--r--tests/auto/quick/qquickbehaviors/data/delete.qml37
-rw-r--r--tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp11
2 files changed, 48 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickbehaviors/data/delete.qml b/tests/auto/quick/qquickbehaviors/data/delete.qml
new file mode 100644
index 0000000000..1bf0267b84
--- /dev/null
+++ b/tests/auto/quick/qquickbehaviors/data/delete.qml
@@ -0,0 +1,37 @@
+import QtQuick 2.12
+
+Item {
+ visible: true
+ width: 640
+ height: 480
+
+ Component.onCompleted: {
+ myLoader.active = false
+ }
+
+ Loader {
+ id: myLoader
+
+ active: true
+ sourceComponent: Item {
+ width: 100
+ height: 100
+ id: myPopup
+
+ NumberAnimation {
+ id: anim
+ }
+
+ Rectangle {
+ color: "black"
+ Component.onCompleted: {
+ opacity = 20
+ }
+
+ Behavior on opacity {
+ animation: anim
+ }
+ }
+ }
+ }
+}
diff --git a/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp b/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp
index 6367f327da..64e32dcdfd 100644
--- a/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp
+++ b/tests/auto/quick/qquickbehaviors/tst_qquickbehaviors.cpp
@@ -74,6 +74,7 @@ private slots:
void aliasedProperty();
void innerBehaviorOverwritten();
void oneWay();
+ void safeToDelete();
};
void tst_qquickbehaviors::simpleBehavior()
@@ -647,6 +648,16 @@ void tst_qquickbehaviors::oneWay()
QCOMPARE(myAnimation->isRunning(), false);
}
+// QTBUG-76749
+void tst_qquickbehaviors::safeToDelete()
+{
+ QQmlEngine engine;
+ QQmlComponent c(&engine, testFileUrl("delete.qml"));
+ QVERIFY(c.create());
+}
+
+
+
QTEST_MAIN(tst_qquickbehaviors)
#include "tst_qquickbehaviors.moc"