44 Q_DECLARE_TR_FUNCTIONS(QFactoryLoader);
47 explicit QFactoryLoader(
const char *iid,
48 const QString &suffix = QString(),
49 Qt::CaseSensitivity = Qt::CaseSensitive);
54 void setLoadHints(QLibrary::LoadHints hints);
56 static void refreshAll();
58#if defined(Q_OS_UNIX) && !defined (Q_OS_DARWIN)
59 QLibraryPrivate *library(
const QString &key)
const;
65 int indexOf(
const QString &needle)
const;
67 using MetaDataList = QList<QPluginParsedMetaData>;
77 mutable QList<QtPluginInstanceFunction> usedStaticInstances;
79 std::optional<QDuplicateTracker<QString>> loadedPaths{std::in_place};
80 std::vector<QLibraryPrivate::UniquePtr> libraries;
81 mutable QList<
bool> loadedLibraries;
82 std::map<QString, QLibraryPrivate*> keyMap;
84 QString extraSearchPath;
85 Qt::CaseSensitivity cs;
86 QLibrary::LoadHints loadHints;
87 void updateSinglePath(
const QString &pluginDir);
91 auto operator->() {
return this; }
92 auto operator->()
const {
return this; }
95 inline QObject *instanceHelper_locked(
int index)
const;
99PluginInterface *
qLoadPlugin(
const QFactoryLoader *loader,
const QString &key, Args &&...args)
101 const int index = loader->indexOf(key);
103 QObject *factoryObject = loader->instance(index);
104 if (FactoryInterface *factory = qobject_cast<FactoryInterface *>(factoryObject))
105 if (PluginInterface *result = factory->create(key,
std::forward<Args>(args)...))