From 78b66c7a696132f5f2dacb9615c7804f3be4954c Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 9 Sep 2020 17:17:12 +0200 Subject: Fix ### Qt 6 comment The inLoop boolean is unused, so remove it. At the same time, there is another boolean that might just as well become a bitflag, so that we can add more members in the future, should the need arise after all. Since we then need to explicitly initialize the member, add a standard QObject constructor. Change-Id: I51245829c1b1192fde62592fb972da6ea2a88e11 Reviewed-by: Andrei Golubev Reviewed-by: Edward Welbourne --- src/testlib/qtesteventloop.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/testlib') diff --git a/src/testlib/qtesteventloop.h b/src/testlib/qtesteventloop.h index b194e24c3a..d576de4267 100644 --- a/src/testlib/qtesteventloop.h +++ b/src/testlib/qtesteventloop.h @@ -56,7 +56,9 @@ class Q_TESTLIB_EXPORT QTestEventLoop : public QObject Q_OBJECT public: - using QObject::QObject; + QTestEventLoop(QObject *parent = nullptr) + : QObject(parent), _timeout(false) + {} inline void enterLoopMSecs(int ms); inline void enterLoop(int secs) { enterLoopMSecs(secs * 1000); } @@ -82,11 +84,10 @@ protected: inline void timerEvent(QTimerEvent *e) override; private: - Q_DECL_UNUSED_MEMBER bool inLoop; // ### Qt 6: remove - bool _timeout = false; - int timerId = -1; - QEventLoop *loop = nullptr; + int timerId = -1; + uint _timeout :1; + Q_DECL_UNUSED_MEMBER uint reserved :31; }; inline void QTestEventLoop::enterLoopMSecs(int ms) -- cgit v1.2.3