diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-09-09 17:17:12 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-09-10 11:24:20 +0200 |
commit | 78b66c7a696132f5f2dacb9615c7804f3be4954c (patch) | |
tree | 768c7d8bfa368b0105af2abd87935bcccae98f32 | |
parent | da77cfb4a60d8109abbd41b151c2dbf56cba25e8 (diff) |
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 <andrei.golubev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
-rw-r--r-- | src/testlib/qtesteventloop.h | 11 |
1 files changed, 6 insertions, 5 deletions
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) |