41 Q_DECLARE_TR_FUNCTIONS(QFactoryLoader);
44 explicit QFactoryLoader(
const char *iid,
45 const QString &suffix = QString(),
46 Qt::CaseSensitivity = Qt::CaseSensitive);
51 void setLoadHints(QLibrary::LoadHints hints);
53 static void refreshAll();
55#if defined(Q_OS_UNIX) && !defined (Q_OS_DARWIN)
56 QLibraryPrivate *library(
const QString &key)
const;
62 int indexOf(
const QString &needle)
const;
64 using MetaDataList = QList<QPluginParsedMetaData>;
74 mutable QList<QtPluginInstanceFunction> usedStaticInstances;
76 QDuplicateTracker<QString> loadedPaths;
77 std::vector<QLibraryPrivate::UniquePtr> libraries;
78 mutable QList<
bool> loadedLibraries;
79 std::map<QString, QLibraryPrivate*> keyMap;
81 QString extraSearchPath;
82 Qt::CaseSensitivity cs;
83 QLibrary::LoadHints loadHints;
84 void updateSinglePath(
const QString &pluginDir);
88 auto operator->() {
return this; }
89 auto operator->()
const {
return this; }
92 inline QObject *instanceHelper_locked(
int index)
const;
96PluginInterface *
qLoadPlugin(
const QFactoryLoader *loader,
const QString &key, Args &&...args)
98 const int index = loader->indexOf(key);
100 QObject *factoryObject = loader->instance(index);
101 if (FactoryInterface *factory = qobject_cast<FactoryInterface *>(factoryObject))
102 if (PluginInterface *result = factory->create(key, std::forward<Args>(args)...))