mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-10 18:38:45 +02:00
Simplify timer use.
This commit is contained in:
parent
5e8fe29674
commit
738da0116a
1 changed files with 1 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue