From af4a872024c31bd11cb369b0f9c0c2d46972b9ec Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Fri, 28 Jan 2022 11:10:53 +0800 Subject: [PATCH] qt 5.12 compatible --- RedPandaIDE/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/RedPandaIDE/main.cpp b/RedPandaIDE/main.cpp index c64e2b78..4203a2e4 100644 --- a/RedPandaIDE/main.cpp +++ b/RedPandaIDE/main.cpp @@ -175,8 +175,12 @@ int main(int argc, char *argv[]) pMainWindow->newEditor(); } } +#if QT_VERSION_MAJOR==5 && QT_VERSION_MINOR < 15 + setScreenDPI(qApp->primaryScreen()->logicalDotsPerInch()); +#else if (mainWindow.screen()) setScreenDPI(mainWindow.screen()->logicalDotsPerInch()); +#endif mainWindow.show(); #ifdef Q_OS_WIN WindowLogoutEventFilter filter;