Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-29503

OSX: QGuiApplication fails to find system plugin (cocoa) if frameworks were deployed with macdeployqt

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Incomplete
    • Affects Version/s: 5.0.0, 5.0.1
    • Fix Version/s: None
    • Component/s: Core: Plugins
    • Labels:
      None
    • Environment:
      OSX 10.8, Qt 5.0.0, Qt 5.0.1
    • Platform/s:
      macOS

      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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            Activity

              People

              Assignee:
              sorvig Morten Sørvig
              Reporter:
              sergei.nevdakh Sergei Nevdakh
              Votes:
              3 Vote for this issue
              Watchers:
              10 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes