QSettingsDialog  1.0.0
A Qt library to easily create a settings dialog for user configurable settings
Public Member Functions | List of all members
QSettingsWidgetFactoryRegistry Class Referenceabstract

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< QSettingsWidgetFactorytryResolve (int displayId)=0
 Tries to find a registry for the given id. More...
 

Detailed Description

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.

Member Function Documentation

QSettingsWidgetFactoryRegistry::priority ( ) const
inlinevirtual

The prioritoy of this registry.

Returns
The priority of this factory.

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.

Note
Priorities are ordered ascending, meaning that a factory with a priority of -100 will be used before one with 0, and one with 100 at the very end.
QSettingsWidgetFactoryRegistry::tryResolve ( int  displayId)
pure virtual

Tries to find a registry for the given id.

Parameters
displayIdThe id that is tried to be resolved
Returns
A factory, if the id was successfully resolve, or 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.


The documentation for this class was generated from the following files: