aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2016-03-07 19:31:56 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2016-03-07 19:31:57 +0100
commitb8fd0ed3a47558b4ace480526cddffa51d6f0580 (patch)
tree926095da42e111933bdb3a63c1a9e0a14fa4041f /tests
parent669c554516736a6735b7286039c56cc0e8d56e05 (diff)
parent443ba99b1ef825e198fe1999c34ee44547135797 (diff)
Merge remote-tracking branch 'origin/5.6' into 5.7
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp b/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp
index c1998ae44e..27ce46d163 100644
--- a/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp
+++ b/tests/auto/quick/qquickanimatedsprite/tst_qquickanimatedsprite.cpp
@@ -30,6 +30,7 @@
#include <QtQuick/qquickview.h>
#include <private/qabstractanimation_p.h>
#include <private/qquickanimatedsprite_p.h>
+#include <private/qquickitem_p.h>
#include <QtGui/qpainter.h>
#include <QtGui/qopenglcontext.h>
#include <QtGui/qopenglfunctions.h>
@@ -48,6 +49,7 @@ private slots:
void test_frameChangedSignal();
void test_largeAnimation_data();
void test_largeAnimation();
+ void test_reparenting();
};
void tst_qquickanimatedsprite::initTestCase()
@@ -263,6 +265,26 @@ void tst_qquickanimatedsprite::test_largeAnimation()
delete window;
}
+void tst_qquickanimatedsprite::test_reparenting()
+{
+ QQuickView window;
+ window.setSource(testFileUrl("basic.qml"));
+ window.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
+
+ QVERIFY(window.rootObject());
+ QQuickAnimatedSprite* sprite = window.rootObject()->findChild<QQuickAnimatedSprite*>("sprite");
+ QVERIFY(sprite);
+
+ QTRY_VERIFY(sprite->running());
+ sprite->setParentItem(0);
+
+ sprite->setParentItem(window.rootObject());
+ // don't crash (QTBUG-51162)
+ sprite->polish();
+ QTRY_COMPARE(QQuickItemPrivate::get(sprite)->polishScheduled, true);
+ QTRY_COMPARE(QQuickItemPrivate::get(sprite)->polishScheduled, false);
+}
QTEST_MAIN(tst_qquickanimatedsprite)