24#ifndef PROPERTYEDITORREGISTRY_H
25#define PROPERTYEDITORREGISTRY_H
46 using Factory = std::function<std::unique_ptr<IPropertyEditor>()>;
69 [[nodiscard]] std::unique_ptr<IPropertyEditor>
create(
const QString &
kind)
const;
79 QHash<QString, Factory> m_factories;
Process-wide dispatch table from editor kind → factory.
Definition propertyeditorregistry.h:44
static PropertyEditorRegistry & instance()
Access the singleton.
Definition propertyeditorregistry.cpp:11
std::unique_ptr< IPropertyEditor > create(const QString &kind) const
Build a fresh editor instance for kind, or nullptr if no factory is registered. Callers are responsib...
Definition propertyeditorregistry.cpp:43
bool hasFactory(const QString &kind) const
True when at least one factory is registered for kind.
Definition propertyeditorregistry.cpp:37
void registerFactory(const QString &kind, Factory factory)
Register a factory for an editor kind. Idempotent on the same (kind, factory) pair; replacing an exis...
Definition propertyeditorregistry.cpp:17
std::function< std::unique_ptr< IPropertyEditor >()> Factory
Definition propertyeditorregistry.h:46
void clear()
Drop every registration. Test-only helper.
Definition propertyeditorregistry.cpp:51
TokenKind kind
Definition queryparser.cpp:34