Do not override QT_QPA_PLATFORM env variables

The QGuiApplication documentation explicitly says that QT_QPA_PLATFORM
can be used to specify the QPA for every QGuiApplication. Unconditionally
overriding this value within the application is a unexpected behavior.

Task-number: QTBUG-54789
Change-Id: Ia7a61a0f2921ef8ec27fe630e8d307d20ba1eb37
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This commit is contained in:
Andreas Cord-Landwehr 2016-07-19 22:00:54 +02:00 committed by Shawn Rutledge
parent 852e60e67b
commit 78f5b9e7f7
1 changed files with 1 additions and 1 deletions

View File

@ -977,7 +977,7 @@ int main(int argc, char *argv[])
}
}
if (!requireWindowManager)
if (!requireWindowManager && qEnvironmentVariableIsEmpty("QT_QPA_PLATFORM"))
qputenv("QT_QPA_PLATFORM", QByteArrayLiteral("minimal"));
else
QCoreApplication::setAttribute(Qt::AA_ShareOpenGLContexts, true);