Qt: set min version to 5.14

This commit is contained in:
Megamouse 2020-02-10 10:57:35 +01:00 committed by Ivan
parent d3abff5486
commit 5d82b0f4c4
4 changed files with 4 additions and 25 deletions

View file

@ -129,19 +129,13 @@ QCoreApplication* createApplication(int& argc, char* argv[])
const auto i_hdpi_2 = (argc > (i_hdpi + 1)) ? (i_hdpi + 1) : 0;
const auto high_dpi_setting = (i_hdpi_2 && !strcmp(cmp_str.c_str(), argv[i_hdpi_2])) ? "0" : "1";
#if (QT_VERSION < QT_VERSION_CHECK(5,14,0))
// Set QT_AUTO_SCREEN_SCALE_FACTOR from environment. Defaults to cli argument, which defaults to 1.
use_high_dpi = "1" == qEnvironmentVariable("QT_AUTO_SCREEN_SCALE_FACTOR", high_dpi_setting);
#else
// Set QT_ENABLE_HIGHDPI_SCALING from environment. Defaults to cli argument, which defaults to 1.
use_high_dpi = "1" == qEnvironmentVariable("QT_ENABLE_HIGHDPI_SCALING", high_dpi_setting);
#endif
}
// AA_EnableHighDpiScaling has to be set before creating a QApplication
QApplication::setAttribute(use_high_dpi ? Qt::AA_EnableHighDpiScaling : Qt::AA_DisableHighDpiScaling);
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
if (use_high_dpi)
{
// Set QT_SCALE_FACTOR_ROUNDING_POLICY from environment. Defaults to cli argument, which defaults to RoundPreferFloor.
@ -193,7 +187,6 @@ QCoreApplication* createApplication(int& argc, char* argv[])
}
QApplication::setHighDpiScaleFactorRoundingPolicy(rounding_val);
}
#endif
return new gui_application(argc, argv);
}
@ -235,9 +228,7 @@ int main(int argc, char** argv)
parser.addOption(QCommandLineOption(arg_headless, "Run RPCS3 in headless mode."));
parser.addOption(QCommandLineOption(arg_no_gui, "Run RPCS3 without its GUI."));
parser.addOption(QCommandLineOption(arg_high_dpi, "Enables Qt High Dpi Scaling.", "enabled", "1"));
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
parser.addOption(QCommandLineOption(arg_rounding, "Sets the Qt::HighDpiScaleFactorRoundingPolicy for values like 150% zoom.", "rounding", "4"));
#endif
parser.addOption(QCommandLineOption(arg_styles, "Lists the available styles."));
parser.addOption(QCommandLineOption(arg_style, "Loads a custom style.", "style", ""));
parser.addOption(QCommandLineOption(arg_stylesheet, "Loads a custom stylesheet.", "path", ""));