qt 5.12 compatible

This commit is contained in:
Roy Qu 2022-01-28 11:10:53 +08:00
parent 52ed44f1f3
commit af4a872024
1 changed files with 4 additions and 0 deletions

View File

@ -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;