From 926303a9f8946a2ff36bfcb57d035b9c870646c0 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 3 Jun 2015 10:04:54 +0200 Subject: qml: Add options to control the GL renderer. Task-number: QTBUG-46030 Change-Id: I5af5a0ef267444d85e8da6df196229ad8199c00f Reviewed-by: Alan Alpert --- tools/qml/main.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tools/qml') diff --git a/tools/qml/main.cpp b/tools/qml/main.cpp index 7e59810cd8..54e3810572 100644 --- a/tools/qml/main.cpp +++ b/tools/qml/main.cpp @@ -274,6 +274,10 @@ void printUsage() printf("\t-f [file] .................... Load the given file as a QML file.\n"); printf("\t-config [file] ............... Load the given file as the configuration file.\n"); printf("\t-- ........................... Arguments after this one are ignored by the launcher, but may be used within the QML application.\n"); + printf("\tGL options:\n"); + printf("\t-desktop.......................Force use of desktop GL (AA_UseDesktopOpenGL)\n"); + printf("\t-gles..........................Force use of GLES (AA_UseOpenGLES)\n"); + printf("\t-software......................Force use of software rendering (AA_UseOpenGLES)\n"); printf("\tDebugging options:\n"); printf("\t-verbose ..................... Print information about what qml is doing, like specific file urls being loaded.\n"); printf("\t-translation [file] .......... Load the given file as the translations file.\n"); @@ -439,6 +443,12 @@ int main(int argc, char *argv[]) continue;//Invalid usage, but just ignore it dummyDir = argList[i+1]; i++; + } else if (arg == QLatin1String("-gles")) { + QCoreApplication::setAttribute(Qt::AA_UseOpenGLES); + } else if (arg == QLatin1String("-software")) { + QCoreApplication::setAttribute(Qt::AA_UseSoftwareOpenGL); + } else if (arg == QLatin1String("-desktop")) { + QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL); } else { //If it ends in .qml, treat it as a file. Else ignore it if (arg.endsWith(".qml")) -- cgit v1.2.3