summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-17 02:18:20 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-17 02:25:50 +0300
commit6b6c02e2236c22136c7b0d8d7141dd19dd0d6386 (patch)
tree8d04504ff3d9af73f18f828c1676f5b60854d939
parentba9a62c836a84d2dbcdd2543f849c87b9278c9b0 (diff)
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>
-rw-r--r--src/qcam/qt_event_dispatcher.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qcam/qt_event_dispatcher.cpp b/src/qcam/qt_event_dispatcher.cpp
index 9e989bef..2780c912 100644
--- a/src/qcam/qt_event_dispatcher.cpp
+++ b/src/qcam/qt_event_dispatcher.cpp
@@ -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;
}