diff --git a/qtbase/src/corelib/plugin/qfactoryloader.cpp b/qtbase/src/corelib/plugin/qfactoryloader.cpp index 582f48e..67ac9cb 100644 --- a/qtbase/src/corelib/plugin/qfactoryloader.cpp +++ b/qtbase/src/corelib/plugin/qfactoryloader.cpp @@ -198,6 +198,9 @@ void QFactoryLoader::update() #ifdef Q_OS_ANDROID QString path = pluginDir; +#elif defined(Q_OS_DARWIN) && !defined(Q_OS_MACOS) + QString path = pluginDir; + const auto suffixWithoutLeadingSlash = d->suffix.remove(0, 1); #else QString path = pluginDir + d->suffix; #endif @@ -213,15 +216,34 @@ void QFactoryLoader::update() QStringList(QStringLiteral("*.dll")), #elif defined(Q_OS_ANDROID) QStringList(QLatin1String("libplugins_%1_*.so").arg(d->suffix)), +#elif defined(Q_OS_DARWIN) && !defined(Q_OS_MACOS) + QStringList(QLatin1String("%1_*.framework").arg(suffixWithoutLeadingSlash)), #endif +#if defined(Q_OS_DARWIN) && !defined(Q_OS_MACOS) + QDir::Dirs); +#else QDir::Files); +#endif QLibraryPrivate *library = nullptr; for (int j = 0; j < plugins.count(); ++j) { QString fileName = QDir::cleanPath(path + QLatin1Char('/') + plugins.at(j)); -#ifdef Q_OS_MAC +#ifdef Q_OS_DARWIN +#if defined(Q_OS_MACOS) const bool isDebugPlugin = fileName.endsWith(QLatin1String("_debug.dylib")); +#else + const auto frameworkFullName = QString{plugins.at(j)}.remove(0, suffixWithoutLeadingSlash.size() + 1); + const auto frameworkName = QString{frameworkFullName}.remove(QLatin1String{".framework"}); + const auto libraryPath = QLatin1String{"%1/%2"}.arg(fileName, frameworkName); +# ifdef QT_DEBUG + const bool isDebugPlugin = true; + fileName = libraryPath + QLatin1String{"_debug"}; +# else + const bool isDebugPlugin = false; + fileName = libraryPath; +# endif +#endif const bool isDebugLibrary = #ifdef QT_DEBUG true;