diff --git a/src/libkirigami/platformtheme.h b/src/libkirigami/platformtheme.h --- a/src/libkirigami/platformtheme.h +++ b/src/libkirigami/platformtheme.h @@ -24,6 +24,7 @@ #include #include #include +#include #ifndef KIRIGAMI_BUILD_TYPE_STATIC #include diff --git a/src/libkirigami/platformtheme.cpp b/src/libkirigami/platformtheme.cpp --- a/src/libkirigami/platformtheme.cpp +++ b/src/libkirigami/platformtheme.cpp @@ -898,7 +898,16 @@ return PlatformThemePrivate::s_pluginFactory->createPlatformTheme(object); } else if (!s_factoryChecked) { s_factoryChecked = true; -#if QT_CONFIG(library) + +#ifdef KIRIGAMI_BUILD_TYPE_STATIC + for (QObject* staticPlugin : QPluginLoader::staticInstances()) { + KirigamiPluginFactory *factory = qobject_cast(staticPlugin); + if (factory) { + PlatformThemePrivate::s_pluginFactory = factory; + return factory->createPlatformTheme(object); + } + } +#else const auto libraryPaths = QCoreApplication::libraryPaths(); for (const QString &path : libraryPaths) { QDir dir(path + QStringLiteral("/kf5/kirigami"));