Mac: Add temporary solution to fix app deployment.

Look for the the platform plugin in "../Plugins" first.
When deployed inside an app bundle this path will
point to the plugin directory inside the app bundle.

Change-Id: I362981a9e0ca9a3e69396b033a571d0b4e2bf78a
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
bb10
Morten Johan Sorvig 2011-12-06 21:09:53 +01:00 committed by Qt by Nokia
parent f0bf2b5149
commit 1b51079e48
1 changed files with 10 additions and 0 deletions

View File

@ -334,6 +334,16 @@ void QGuiApplicationPrivate::createPlatformIntegration()
// Load the platform integration
QString platformPluginPath = QLatin1String(qgetenv("QT_QPA_PLATFORM_PLUGIN_PATH"));
// On Mac, look inside the application bundle for the platform plugin.
// TODO (msorvig): Create proper cross-platform solution for loading
// deployed platform plugins
#ifdef Q_OS_MAC
if (platformPluginPath.isEmpty()) {
platformPluginPath = QCoreApplication::applicationDirPath() + QLatin1String("../Plugins/");
}
#endif
QByteArray platformName;
#ifdef QT_QPA_DEFAULT_PLATFORM_NAME
platformName = QT_QPA_DEFAULT_PLATFORM_NAME;