From 00947bc7ad4b3afaeb93be08931962c85db6875e Mon Sep 17 00:00:00 2001 From: initramfs Date: Mon, 4 Apr 2016 22:19:04 -0400 Subject: [PATCH] refactor(video): simplifies retrieval of primary screen This commit reduces primary screen retrieval to a single static field access as opposed to obtaining a runtime instance of the QApplication object --- src/video/cameradevice.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/cameradevice.cpp b/src/video/cameradevice.cpp index 4f1577999..ba0a7adc4 100644 --- a/src/video/cameradevice.cpp +++ b/src/video/cameradevice.cpp @@ -133,7 +133,7 @@ CameraDevice* CameraDevice::open(QString devName, VideoMode mode) } else { - QScreen* defaultScreen = static_cast(QGuiApplication::instance())->primaryScreen(); + QScreen* defaultScreen = QApplication::primaryScreen(); qreal pixRatio; #if (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0))