diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2023-03-21 18:49:30 -1000 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2023-04-18 19:23:46 -0300 |
commit | cf1b8740b95f442f325109002e26ca90ff58a9b4 (patch) | |
tree | 37978ce5d637e6323a6fbced767885bfe2866de2 | |
parent | 39be743e5cde56f6a8af55475ed39f53c6d02a51 (diff) |
QDeadlineTimer: stop using the t2 member and mark for removal in Qt 7
Change-Id: Ieec322d73c1e40ad95c8fffd17465c06aca0c14a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
-rw-r--r-- | src/corelib/kernel/qdeadlinetimer.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/corelib/kernel/qdeadlinetimer.h b/src/corelib/kernel/qdeadlinetimer.h index 37111215a1..c4be957985 100644 --- a/src/corelib/kernel/qdeadlinetimer.h +++ b/src/corelib/kernel/qdeadlinetimer.h @@ -32,7 +32,7 @@ public: explicit QDeadlineTimer(qint64 msecs, Qt::TimerType type = Qt::CoarseTimer) noexcept; void swap(QDeadlineTimer &other) noexcept - { std::swap(t1, other.t1); std::swap(t2, other.t2); std::swap(type, other.type); } + { std::swap(t1, other.t1); std::swap(type, other.type); } constexpr bool isForever() const noexcept { return t1 == (std::numeric_limits<qint64>::max)(); } @@ -58,11 +58,11 @@ public: static QDeadlineTimer current(Qt::TimerType timerType = Qt::CoarseTimer) noexcept; friend bool operator==(QDeadlineTimer d1, QDeadlineTimer d2) noexcept - { return d1.t1 == d2.t1 && d1.t2 == d2.t2; } + { return d1.t1 == d2.t1; } friend bool operator!=(QDeadlineTimer d1, QDeadlineTimer d2) noexcept { return !(d1 == d2); } friend bool operator<(QDeadlineTimer d1, QDeadlineTimer d2) noexcept - { return d1.t1 < d2.t1 || (d1.t1 == d2.t1 && d1.t2 < d2.t2); } + { return d1.t1 < d2.t1; } friend bool operator<=(QDeadlineTimer d1, QDeadlineTimer d2) noexcept { return d1 == d2 || d1 < d2; } friend bool operator>(QDeadlineTimer d1, QDeadlineTimer d2) noexcept @@ -137,7 +137,9 @@ public: private: qint64 t1 = 0; +#if QT_VERSION < QT_VERSION_CHECK(7, 0, 0) unsigned t2 = 0; +#endif unsigned type; qint64 rawRemainingTimeNSecs() const noexcept; |