qcam: Support Qt versions earlier than 5.9

The QtEventDispatcher timers implementation depends on Qt 5.9 or newer
due to the use of QObject::startTimer(std::chrono::milliseconds).
Support earlier Qt versions by using the QObject::startTimer(int)
version instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
Laurent Pinchart
2019-10-17 02:18:20 +03:00
parent ba9a62c836
commit 6b6c02e223
+1 -1
View File
@@ -117,7 +117,7 @@ void QtEventDispatcher::registerTimer(Timer *timer)
std::chrono::steady_clock::duration duration = timer->deadline() - now;
std::chrono::milliseconds msec =
std::chrono::duration_cast<std::chrono::milliseconds>(duration);
int timerId = startTimer(msec);
int timerId = startTimer(msec.count());
timers_[timerId] = timer;
timerIds_[timer] = timerId;
}