From dbaf9685ca58580e7691958735458706fa3196da Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 15 Jan 2020 10:55:27 +0100 Subject: qml: Fix options that need to be set before QApplication instantiation Move the Open GL and scaling options setting QCoreApplication attributes into the helper getAppFlags() which already handles the application type. Change getAppFlags() to not modify argv which is not necessary since the parser will accept the options. Change-Id: Ib2f94f832e6551a938ff0e9bfe27649850d38d1e Reviewed-by: Ulf Hermann --- tools/qml/main.cpp | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) (limited to 'tools') diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index daa278457d..15b3539188 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -332,26 +332,35 @@ void quietMessageHandler(QtMsgType type, const QMessageLogContext &ctxt, const Q } } -// Called before application initialization, removes arguments it uses -void getAppFlags(int &argc, char **argv) +// Called before application initialization +static void getAppFlags(int argc, char **argv) { #ifdef QT_GUI_LIB for (int i=0; isetConsistentTiming(true); #endif - if (parser.isSet(glEsOption)) - QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); - if (parser.isSet(glSoftwareOption)) - QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); - if (parser.isSet(glDesktopOption)) - QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL); - if (parser.isSet(scalingOption)) - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - if (parser.isSet(noScalingOption)) - QCoreApplication::setAttribute(Qt::AA_DisableHighDpiScaling); for (const QString &importPath : parser.values(importOption)) e.addImportPath(importPath); files << parser.values(qmlFileOption); -- cgit v1.2.3