From 1b51079e48d647a3863ff8a996e60c45f6e62fdb Mon Sep 17 00:00:00 2001 From: Morten Johan Sorvig Date: Tue, 6 Dec 2011 21:09:53 +0100 Subject: [PATCH] Mac: Add temporary solution to fix app deployment. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/gui/kernel/qguiapplication.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; -- 2.7.4