25 QTestEventLoop(QObject *parent =
nullptr)
26 : QObject(parent), _timeout(
false)
29 void enterLoopMSecs(
int ms) { enterLoop(std::chrono::milliseconds{ms}); }
30 void enterLoop(
int secs) { enterLoop(std::chrono::seconds{secs}); }
31 inline void enterLoop(std::chrono::milliseconds msecs);
33 inline void changeInterval(
int secs)
34 { changeInterval(std::chrono::seconds{secs}); }
36 void changeInterval(std::chrono::nanoseconds nsecs)
37 { timer.start(nsecs,
this); }
39 inline bool timeout()
const
42 inline static QTestEventLoop &instance()
44 Q_CONSTINIT
static QPointer<QTestEventLoop> testLoop;
45 if (testLoop.isNull())
46 testLoop =
new QTestEventLoop(QCoreApplication::instance());
47 return *
static_cast<QTestEventLoop *>(testLoop);
51 inline void exitLoop();
54 inline void timerEvent(QTimerEvent *e) override;
57 QEventLoop *loop =
nullptr;
60 Q_DECL_UNUSED_MEMBER uint reserved :31;