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>
This commit is contained in:
Volker Hilsheimer 2020-09-09 17:17:12 +02:00
parent da77cfb4a6
commit 78b66c7a69

View File

@ -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)