QSettingsDialog
1.0.0
A Qt library to easily create a settings dialog for user configurable settings
|
A registry to load widget factories based on an id. More...
#include <qsettingswidgetfactoryregistry.h>
Public Member Functions | |
virtual | ~QSettingsWidgetFactoryRegistry () |
Virtual Destructor. | |
virtual int | priority () const |
The prioritoy of this registry. More... | |
virtual QSharedPointer< QSettingsWidgetFactory > | tryResolve (int displayId)=0 |
Tries to find a registry for the given id. More... | |
A registry to load widget factories based on an id.
Normally, you will not need to create a factory registry. You only have factories (QSettingsWidgetFactory) or directly registered QSettingsWidgets. However, in some cases you may need to provide an alternative way of finding those factories. In that case, the registry is what you need.
The dialog engine uses multiple registries, and will try to find a factory for a given id in one of these. The order is determined by the priority of each registry.
|
inlinevirtual |
The prioritoy of this registry.
The prioritoy is used to order the factories. The priority for a factory type should be constant, because it will be only used once, when the factory is inserted into the list of factories. The default implementation returns 0
.
-100
will be used before one with 0
, and one with 100
at the very end.
|
pure virtual |
Tries to find a registry for the given id.
displayId | The id that is tried to be resolved |
nullptr
, if it was not resolved.This function should check whether the id is know, and if yes return a fitting factory. If not, just return nullptr
. If a value is returned, the given factory will be used by the engine to create the edit widget. If it's null, the next factory in the list will be asked usw until either all registries are done or a factory was found.