From patchwork Wed Oct 16 23:20:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 2194 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CC39060E1B for ; Thu, 17 Oct 2019 01:20:26 +0200 (CEST) Received: from pendragon.bb.dnainternet.fi (dfj612yhrgyx302h3jwwy-3.rev.dnainternet.fi [IPv6:2001:14ba:21f5:5b00:ce28:277f:58d7:3ca4]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3E9AB4FE for ; Thu, 17 Oct 2019 01:20:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1571268026; bh=VSJzZoJ3R2k6i70hVWHgBS6MqUdBVcv43lxqvc/4ZGE=; h=From:To:Subject:Date:From; b=q+NITF60WXrMK96ltAIaAt2+HFwhFgMhJrKi94dItmcBNua1p+H/TuM7/daZ6GXHq dg5WtQ5hsRva1oTqgOxLvxHN1m059tI5yVnjQqGWfzUyrVbbPZ7g884cwRmT2wP5R9 dUQbEcUfXjsOTMJdsPXoAx9QWgZozqr4+Q513zMg= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Thu, 17 Oct 2019 02:20:18 +0300 Message-Id: <20191016232018.30239-1-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] qcam: Support Qt versions earlier than 5.9 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Oct 2019 23:20:27 -0000 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 Reviewed-by: Niklas Söderlund --- src/qcam/qt_event_dispatcher.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qcam/qt_event_dispatcher.cpp b/src/qcam/qt_event_dispatcher.cpp index 9e989bef7d53..2780c9123ac3 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(duration); - int timerId = startTimer(msec); + int timerId = startTimer(msec.count()); timers_[timerId] = timer; timerIds_[timer] = timerId; }