From 065c3f5732fa98a83202b526fbec9839b765eb48 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Tue, 2 Feb 2021 11:45:19 +0100 Subject: Make the internals of QQuickAnimatorController private No one should mess with those. All the pointers have complicated ownership semantics. We can just befriend the test instead of making it all public. Task-number: QTBUG-90401 Change-Id: I6c4adbab7046b40db7f4628780ef928445ea3eb2 Reviewed-by: Fabian Kosmale --- src/quick/util/qquickanimatorcontroller_p.h | 3 ++- tests/auto/quick/qquickanimators/tst_qquickanimators.cpp | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/quick/util/qquickanimatorcontroller_p.h b/src/quick/util/qquickanimatorcontroller_p.h index 9c345b8152..c567c8ad43 100644 --- a/src/quick/util/qquickanimatorcontroller_p.h +++ b/src/quick/util/qquickanimatorcontroller_p.h @@ -93,10 +93,11 @@ public: QQuickWindow *window() const { return m_window; } private: + friend class tst_Animators; + void start_helper(QAbstractAnimationJob *job); void cancel_helper(QAbstractAnimationJob *job); -public: QSet m_runningAnimators; QHash > m_animationRoots; QSet > m_rootsPendingStop; diff --git a/tests/auto/quick/qquickanimators/tst_qquickanimators.cpp b/tests/auto/quick/qquickanimators/tst_qquickanimators.cpp index 34aace57a0..30a1d5a560 100644 --- a/tests/auto/quick/qquickanimators/tst_qquickanimators.cpp +++ b/tests/auto/quick/qquickanimators/tst_qquickanimators.cpp @@ -42,6 +42,8 @@ using namespace QQuickViewTestUtil; +QT_BEGIN_NAMESPACE + class tst_Animators: public QQmlDataTest { Q_OBJECT @@ -180,6 +182,8 @@ void tst_Animators::testTransitionsWithImplicitFrom() QVERIFY(controller->m_runningAnimators.isEmpty()); } +QT_END_NAMESPACE + QTEST_MAIN(tst_Animators) #include "tst_qquickanimators.moc" -- cgit v1.2.3