QDeadlineTimer: add a few missing default template parameters

I don't think any of these make a difference because the Duration is an
implied parameter because of the time_point arguments, but this makes
the code match QDeadlineTimer::deadline<T>.

Pick-to: 6.5
Change-Id: Ieec322d73c1e40ad95c8fffd17468a41182944ab
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Thiago Macieira 2023-02-23 11:18:43 -08:00
parent 81783d02e8
commit ec2c27d596

View File

@ -82,15 +82,15 @@ public:
QDeadlineTimer &operator-=(qint64 msecs)
{ *this = *this + (-msecs); return *this; }
template <class Clock, class Duration>
template <class Clock, class Duration = typename Clock::duration>
QDeadlineTimer(std::chrono::time_point<Clock, Duration> deadline_,
Qt::TimerType type_ = Qt::CoarseTimer) : t2(0)
{ setDeadline(deadline_, type_); }
template <class Clock, class Duration>
template <class Clock, class Duration = typename Clock::duration>
QDeadlineTimer &operator=(std::chrono::time_point<Clock, Duration> deadline_)
{ setDeadline(deadline_); return *this; }
template <class Clock, class Duration>
template <class Clock, class Duration = typename Clock::duration>
void setDeadline(std::chrono::time_point<Clock, Duration> deadline_,
Qt::TimerType type_ = Qt::CoarseTimer)
{ setRemainingTime(deadline_ == deadline_.max() ? Duration::max() : deadline_ - Clock::now(), type_); }