diff --git a/qtdeclarative/src/qml/qml/qqmlimport.cpp b/qtdeclarative/src/qml/qml/qqmlimport.cpp index 10c6c41..421c20c 100644 --- a/qtdeclarative/src/qml/qml/qqmlimport.cpp +++ b/qtdeclarative/src/qml/qml/qqmlimport.cpp @@ -1949,6 +1949,9 @@ QString QQmlImportDatabase::resolvePlugin(QQmlTypeLoader *typeLoader, searchPaths.prepend(qmldirPluginPath); for (const QString &pluginPath : qAsConst(searchPaths)) { +#if defined(Q_OS_DARWIN) && !defined(Q_OS_MACOS) + QString resolvedPath = QCoreApplication::applicationDirPath() + QLatin1String("/Frameworks/"); +#else QString resolvedPath; if (pluginPath == QLatin1String(".")) { if (qmldirPluginPathIsRelative && !qmldirPluginPath.isEmpty() && qmldirPluginPath != QLatin1String(".")) @@ -1961,6 +1964,7 @@ QString QQmlImportDatabase::resolvePlugin(QQmlTypeLoader *typeLoader, else resolvedPath = pluginPath; } +#endif // hack for resources, should probably go away if (resolvedPath.startsWith(Colon)) @@ -1983,6 +1987,9 @@ QString QQmlImportDatabase::resolvePlugin(QQmlTypeLoader *typeLoader, } #endif resolvedPath += prefix + baseName; +#if defined(Q_OS_DARWIN) && !defined(Q_OS_MACOS) + resolvedPath += QLatin1String(".framework/") + baseName; +#endif for (const QString &suffix : suffixes) { const QString absolutePath = typeLoader->absoluteFilePath(resolvedPath + suffix); if (!absolutePath.isEmpty()) @@ -2027,17 +2034,28 @@ QString QQmlImportDatabase::resolvePlugin(QQmlTypeLoader *typeLoader, # endif }; #elif defined(Q_OS_DARWIN) +# if defined(Q_OS_MACOS) static const QString prefix = QLatin1String("lib"); +# else + static const QString prefix; +# endif static const QStringList suffixes = { -# ifdef QT_DEBUG +# if defined(Q_OS_MACOS) +# ifdef QT_DEBUG QLatin1String("_debug.dylib"), // try a qmake-style debug build first QLatin1String(".dylib"), -# else +# else QLatin1String(".dylib"), QLatin1String("_debug.dylib"), // try a qmake-style debug build after -# endif +# endif QLatin1String(".so"), QLatin1String(".bundle") +# else +# ifdef QT_DEBUG + QLatin1String("_debug"), // try a qmake-style debug build first +# endif + QString{} +# endif }; #else // Unix static const QString prefix = QLatin1String("lib");