commit 1b51079e48d647a3863ff8a996e60c45f6e62fdb Author: Morten Johan Sorvig Date: Tue Dec 6 21:09:53 2011 +0100 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 Reviewed-by: Bradley T. Hughes diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 312d8f5..f669a8f 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -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;