From 12ab54648cb04d79c446a089f1652c05da1c6264 Mon Sep 17 00:00:00 2001 From: Pavel Rojtberg Date: Sat, 12 Feb 2022 14:56:42 +0100 Subject: [PATCH] highui: qt - enable hidpi by default can be overriden by environment: QT_AUTO_SCREEN_SCALE_FACTOR=0 --- modules/highgui/src/window_QT.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/highgui/src/window_QT.cpp b/modules/highgui/src/window_QT.cpp index f6ba44b425..d8f2271faa 100644 --- a/modules/highgui/src/window_QT.cpp +++ b/modules/highgui/src/window_QT.cpp @@ -529,6 +529,9 @@ static int icvInitSystem(int* c, char** v) //"For any GUI application using Qt, there is precisely one QApplication object" if (!QApplication::instance()) { +#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0) + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling, true); +#endif new QApplication(*c, v); setlocale(LC_NUMERIC,"C");