From 6d52fc8694ccc9e79c9d5616db44b44b1d2e1540 Mon Sep 17 00:00:00 2001 From: Frank Osterfeld Date: Thu, 21 Apr 2016 17:38:44 +0200 Subject: [PATCH] Enable High-DPI support for Qt 5.6 and higher This fixes size hint issues in the event editor on Windows, at least for me. Fixes #269 Change-Id: I2a31c9c0aaa4275c17d57ab6e17e84adcb0f1339 Reviewed-on: https://codereview.kdab.com/32523 Tested-by: Continuous Integration Reviewed-by: Hannah von Reth --- Charm/Charm.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Charm/Charm.cpp b/Charm/Charm.cpp index e692784b..ed8ab61f 100644 --- a/Charm/Charm.cpp +++ b/Charm/Charm.cpp @@ -86,6 +86,9 @@ int main ( int argc, char** argv ) } try { +#if QT_VERSION >= QT_VERSION_CHECK(5,6,0) + QGuiApplication::setAttribute( Qt::AA_EnableHighDpiScaling ); +#endif QApplication app( argc, argv ); const std::shared_ptr core( createApplicationCore( startupTask ) ); QObject::connect( &app, SIGNAL(commitDataRequest(QSessionManager&)), core.get(), SLOT(commitData(QSessionManager&)) );