From 4234ea4479ca858d058840eec01760a387e4afb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Lind?= Date: Fri, 18 Mar 2011 10:42:14 +0100 Subject: Lighthouse: Make it possible to compile in default platform plugin --- src/gui/kernel/qapplication_qpa.cpp | 13 ++++++++++--- 1 file 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 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(); -- cgit v0.12