77void QExtensionManager::registerExtensions(QAbstractExtensionFactory *factory,
const QString &iid)
80 m_globalExtension.prepend(factory);
84 auto it = m_extensions.find(iid);
85 if (it == m_extensions.end())
86 it = m_extensions.insert(iid, FactoryList());
88 it.value().prepend(factory);
95void QExtensionManager::unregisterExtensions(QAbstractExtensionFactory *factory,
const QString &iid)
98 m_globalExtension.removeAll(factory);
102 const auto it = m_extensions.find(iid);
103 if (it == m_extensions.end())
106 FactoryList &factories = it.value();
107 factories.removeAll(factory);
109 if (factories.isEmpty())
110 m_extensions.erase(it);
117QObject *QExtensionManager::extension(QObject *object,
const QString &iid)
const
119 const auto it = m_extensions.constFind(iid);
120 if (it != m_extensions.constEnd()) {
121 for (
const auto &f : it.value()) {
122 if (QObject *ext = f->extension(object, iid))
127 for (
const auto &gf : m_globalExtension) {
128 if (QObject *ext = gf->extension(object, iid))