tst_QPropertyAnimation: fix wrong comment
... and add some additional checks that hopefully leave the next reader of the code a little less confused than this one was. Pick-to: 6.3 6.2 5.15 Change-Id: I73c1b9b1ed1683e3b2de0d811d9b20d65464dff4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
This commit is contained in:
parent
c31fecd27f
commit
2fef4636aa
@ -421,9 +421,10 @@ void tst_QPropertyAnimation::deletion1()
|
|||||||
void tst_QPropertyAnimation::deletion2()
|
void tst_QPropertyAnimation::deletion2()
|
||||||
{
|
{
|
||||||
TestAnimationDriver timeDriver;
|
TestAnimationDriver timeDriver;
|
||||||
//test that the animation get deleted if the object is deleted
|
// test that the animation does not get deleted if the object is deleted
|
||||||
QObject *object = new QWidget;
|
QObject *object = new QWidget;
|
||||||
QPointer<QPropertyAnimation> anim = new QPropertyAnimation(object,"minimumWidth");
|
QPointer<QPropertyAnimation> anim = new QPropertyAnimation(object,"minimumWidth");
|
||||||
|
QVERIFY(anim->parent() != object);
|
||||||
anim->setStartValue(10);
|
anim->setStartValue(10);
|
||||||
anim->setEndValue(20);
|
anim->setEndValue(20);
|
||||||
anim->setDuration(200);
|
anim->setDuration(200);
|
||||||
@ -450,7 +451,10 @@ void tst_QPropertyAnimation::deletion2()
|
|||||||
QTimer::singleShot(0, object, SLOT(deleteLater()));
|
QTimer::singleShot(0, object, SLOT(deleteLater()));
|
||||||
timeDriver.wait(50);
|
timeDriver.wait(50);
|
||||||
|
|
||||||
|
QVERIFY(anim);
|
||||||
QVERIFY(!anim->targetObject());
|
QVERIFY(!anim->targetObject());
|
||||||
|
|
||||||
|
delete anim;
|
||||||
}
|
}
|
||||||
|
|
||||||
void tst_QPropertyAnimation::deletion3()
|
void tst_QPropertyAnimation::deletion3()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user