From 738da0116a58f126b0ec7ea1b62f5f8e72c1704e Mon Sep 17 00:00:00 2001 From: Howard Stearns Date: Wed, 9 Sep 2015 15:19:01 -0700 Subject: [PATCH] Simplify timer use. --- tests/animation/src/AnimTests.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/animation/src/AnimTests.cpp b/tests/animation/src/AnimTests.cpp index 806560d96f..c2bb5a9350 100644 --- a/tests/animation/src/AnimTests.cpp +++ b/tests/animation/src/AnimTests.cpp @@ -131,17 +131,13 @@ void AnimTests::testLoader() { const int timeout = 1000; QEventLoop loop; - QTimer timer; - timer.setInterval(timeout); - timer.setSingleShot(true); AnimNode::Pointer node = nullptr; connect(&loader, &AnimNodeLoader::success, [&](AnimNode::Pointer nodeIn) { node = nodeIn; }); loop.connect(&loader, SIGNAL(success(AnimNode::Pointer)), SLOT(quit())); loop.connect(&loader, SIGNAL(error(int, QString)), SLOT(quit())); - loop.connect(&timer, SIGNAL(timeout()), SLOT(quit())); - timer.start(); + QTimer::singleShot(timeout, &loader, SLOT(quit())); loop.exec(); QVERIFY((bool)node);