From b974c6bbe0f19e884de9a684c6fc410dd42b6540 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 19 Aug 2019 11:30:28 +0200 Subject: [PATCH] CustomVideoManager: Use qobject_cast qobject_cast is times faster then dynamic_cast for objects that inherit QObject. also, use auto keyword to not repeat the class name --- custom-example/src/CustomVideoManager.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom-example/src/CustomVideoManager.cc b/custom-example/src/CustomVideoManager.cc index 7e72973da..047c66eba 100644 --- a/custom-example/src/CustomVideoManager.cc +++ b/custom-example/src/CustomVideoManager.cc @@ -26,7 +26,7 @@ CustomVideoManager::_updateSettings() return; //-- Check encoding if(_activeVehicle && _activeVehicle->dynamicCameras()) { - CustomCameraControl* pCamera = dynamic_cast(_activeVehicle->dynamicCameras()->currentCameraInstance()); + auto* pCamera = qobject_cast(_activeVehicle->dynamicCameras()->currentCameraInstance()); if(pCamera) { Fact *fact = pCamera->videoEncoding(); if (fact) { -- 2.22.0