diff options
| author | spycrab <spycrab@users.noreply.github.com> | 2021-04-25 02:18:28 +0200 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2022-05-02 22:39:33 -0700 |
| commit | 004e8a80b2cd577f0dd6b7b998d11181798c69da (patch) | |
| tree | 36db877c0f28a524ec36dc5a1aeaa97581903a3c /Source/Core/DolphinQt/Main.cpp | |
| parent | f8c603a2dd6a79dbf6efb172bcde50508918a02a (diff) | |
Add support for building against Qt 6
Diffstat (limited to 'Source/Core/DolphinQt/Main.cpp')
| -rw-r--r-- | Source/Core/DolphinQt/Main.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Source/Core/DolphinQt/Main.cpp b/Source/Core/DolphinQt/Main.cpp index 88f716b5a6..defffa5e42 100644 --- a/Source/Core/DolphinQt/Main.cpp +++ b/Source/Core/DolphinQt/Main.cpp @@ -132,8 +132,15 @@ int main(int argc, char* argv[]) const optparse::Values& options = CommandLineParse::ParseArguments(parser.get(), argc, argv); const std::vector<std::string> args = parser->args(); + // setHighDpiScaleFactorRoundingPolicy was added in 5.14, but default behavior changed in 6.0 +#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) + // Set to the previous default behavior + QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Round); +#else QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); +#endif + QCoreApplication::setOrganizationName(QStringLiteral("Dolphin Emulator")); QCoreApplication::setOrganizationDomain(QStringLiteral("dolphin-emu.org")); QCoreApplication::setApplicationName(QStringLiteral("dolphin-emu")); @@ -144,7 +151,7 @@ int main(int argc, char* argv[]) QApplication app(argc, argv); #endif -#ifdef _WIN32 +#if defined(_WIN32) && (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) // On Windows, Qt 5's default system font (MS Shell Dlg 2) is outdated. // Interestingly, the QMenu font is correct and comes from lfMenuFont // (Segoe UI on English computers). |
