diff options
-rw-r--r-- | src/gui/kernel/qapplication_qpa.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/kernel/qapplication_qpa.cpp b/src/gui/kernel/qapplication_qpa.cpp index cb5439c..1d4400a 100644 --- a/src/gui/kernel/qapplication_qpa.cpp +++ b/src/gui/kernel/qapplication_qpa.cpp @@ -514,7 +514,14 @@ void qt_init(QApplicationPrivate *priv, int type) QList<QByteArray> pluginList; QString platformPluginPath = QLatin1String(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH")); - QString platformName = QLatin1String(qgetenv("QT_QPA_PLATFORM")); + QByteArray platformName; +#ifdef QT_QPA_DEFAULT_PLATFORM_NAME + platformName = QT_QPA_DEFAULT_PLATFORM_NAME; +#endif + QByteArray platformNameEnv = qgetenv("QT_QPA_PLATFORM"); + if (!platformNameEnv.isEmpty()) { + platformName = platformNameEnv; + } // Get command line params @@ -533,7 +540,7 @@ void qt_init(QApplicationPrivate *priv, int type) platformPluginPath = QLatin1String(argv[i]); } else if (arg == "-platform") { if (++i < argc) - platformName = QLatin1String(argv[i]); + platformName = argv[i]; } else if (arg == "-plugin") { if (++i < argc) pluginList << argv[i]; @@ -554,7 +561,7 @@ void qt_init(QApplicationPrivate *priv, int type) } #endif - init_platform(platformName, platformPluginPath); + init_platform(QLatin1String(platformName), platformPluginPath); init_plugins(pluginList); QColormap::initialize(); |