Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
None
-
5.0.0, 5.0.1
-
None
-
OSX 10.8, Qt 5.0.0, Qt 5.0.1
Description
QGuiApplication fails to find and load cocoa plugin, if Qt frameworks were deployed with macdeployqt utility.
In code below the search path is broken.
1. macdeployqt puts plugins into bundle/Contents/PlugIns, and there is 'Plugins' string hard-coded
2. separator is missed. QCoreApplication::applicationDirPath() + QLatin1String("../Plugins/") will result in something like "Application.app/Contents/Macos../Plugins"
3. This logic is completely broken for loadable bundles (For example, native executable and Qt based loadable bundle or plugin). applicationDirPath() will return path for exetutable, not for loadable bundle.
void QGuiApplicationPrivate::createPlatformIntegration()
...
// 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
const QString bundlePluginPath = QCoreApplication::applicationDirPath() + QLatin1String("../Plugins/");
if (platformPluginPath.isEmpty() && QDir(bundlePluginPath).exists()) {
platformPluginPath = bundlePluginPath;
}
#endif
The only way to load plugin now is to pass -platformpluginpath with arguments.
Application should search for platform plugin in plugins path from qt.conf file and/or in libraryPaths
P.S. https://bugreports.qt-project.org/secure/ViewProfile.jspa?name=sorvig seems to be responsible person.
Attachments
Issue Links
- duplicates
-
QTBUG-29550 Can't set path to a platform plugin in a portable way
- Closed