mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2025-07-03 15:55:27 +08:00
6.5.3 clean
This commit is contained in:
@ -7,6 +7,7 @@
|
||||
#include <QSignalSpy>
|
||||
|
||||
#include <QtCore/qparallelanimationgroup.h>
|
||||
#include <QtCore/qscopeguard.h>
|
||||
|
||||
Q_DECLARE_METATYPE(QAbstractAnimation::State)
|
||||
|
||||
@ -928,6 +929,7 @@ void tst_QParallelAnimationGroup::autoAdd()
|
||||
|
||||
test = static_cast<TestAnimation2*>(group.animationAt(0));
|
||||
test->setParent(0); // remove the last one (with duration = 250)
|
||||
const auto deleteParentlessObject = qScopeGuard([test] { delete test; });
|
||||
QCOMPARE(test->group(), static_cast<QAnimationGroup*>(0));
|
||||
QCOMPARE(group.duration(), 0);
|
||||
}
|
||||
|
@ -10,4 +10,5 @@ qt_internal_add_test(tst_qpauseanimation
|
||||
tst_qpauseanimation.cpp
|
||||
LIBRARIES
|
||||
Qt::CorePrivate
|
||||
Qt::TestPrivate
|
||||
)
|
||||
|
@ -2,6 +2,7 @@
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QTest>
|
||||
#include <QtTest/private/qpropertytesthelper_p.h>
|
||||
|
||||
#include <QtCore/qpauseanimation.h>
|
||||
#include <QtCore/qpropertyanimation.h>
|
||||
@ -456,6 +457,12 @@ void tst_QPauseAnimation::bindings()
|
||||
"QPauseAnimation::setDuration: cannot set a negative duration");
|
||||
animation.setDuration(-1);
|
||||
QCOMPARE(durationObserver, 46);
|
||||
|
||||
QTestPrivate::testReadWritePropertyBasics(animation, 10, 20, "duration");
|
||||
if (QTest::currentTestFailed()) {
|
||||
qDebug("Failed property test for QPauseAnimation::duration");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QPauseAnimation)
|
||||
|
@ -8,4 +8,6 @@
|
||||
qt_internal_add_test(tst_qsequentialanimationgroup
|
||||
SOURCES
|
||||
tst_qsequentialanimationgroup.cpp
|
||||
LIBRARIES
|
||||
Qt::TestPrivate
|
||||
)
|
||||
|
@ -2,6 +2,8 @@
|
||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||
|
||||
#include <QTest>
|
||||
#include <QtTest/private/qpropertytesthelper_p.h>
|
||||
|
||||
#include <QVariantAnimation>
|
||||
#include <QProperty>
|
||||
#include <QPropertyAnimation>
|
||||
@ -1685,6 +1687,15 @@ void tst_QSequentialAnimationGroup::bindings()
|
||||
group.bindableCurrentAnimation().setBinding([&]() { return leader.value(); });
|
||||
|
||||
QCOMPARE(group.currentAnimation(), anim3.get());
|
||||
|
||||
QTestPrivate::testReadOnlyPropertyBasics(group, anim3.get(), anim2.get(), "currentAnimation",
|
||||
[&group, totalDuration]() {
|
||||
group.setCurrentTime(int(totalDuration * 1.5 / 3));
|
||||
});
|
||||
if (QTest::currentTestFailed()) {
|
||||
qDebug("Failed property test for QSequentialAnimationGroup::currentAnimation");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_QSequentialAnimationGroup)
|
||||
|
Reference in New Issue
Block a user