QSettingsDialog
1.0.0
A Qt library to easily create a settings dialog for user configurable settings
|
The display module of the dialog library. More...
Classes | |
class | QSettingsWidgetDialogEngine |
The default engine implementation for the settings dialog. More... | |
class | QSettingsWidgetBase |
The base class for edit widgets in the settings dialog. More... | |
class | QSettingsWidget< TWidget > |
Generic base class for settings widgets. More... | |
class | QSettingsWidgetFactory |
The base class for a factory to create QSettingsWidgets. More... | |
class | GenericSettingsWidgetFactory< TSettingsWidget > |
[INTERNAL USE] Generic base class for a factory to create QSettingsWidgets More... | |
class | QSettingsWidgetFactoryRegistry |
A registry to load widget factories based on an id. More... | |
class | QSettingsDialogWidgetBase |
The base class for dialog based edit widgets in the settings dialog. More... | |
class | QSettingsDialogWidget< TSettingsWidget > |
A generic class to easily create a dialog widget from a normal one. More... | |
class | QSettingsGroupWidgetBase |
The base class for group widgets in the settings dialog. More... | |
class | QSettingsGroupWidget< TWidget > |
Generic base class for group widgets. More... | |
class | QSettingsGroupWidgetFactory |
The base class for a factory to create QSettingsGroupWidgets. More... | |
class | GenericSettingsGroupWidgetFactory< TSettingsGroupWidget > |
[INTERNAL USE] Generic base class for a factory to create QSettingsWidgets More... | |
Macros | |
#define | REGISTER_TYPE_CONVERTERS(TypeA, TypeB) |
A macro for type converter registration. More... | |
#define | REGISTER_FLAG_CONVERTERS(FlagsType) REGISTER_TYPE_CONVERTERS(FlagsType, int) |
A macro to register flag types. More... | |
The display module of the dialog library.
The Dialog-UI part of the library is responsible for creating the actual visible dialog from the cores data. This module defines the QSettingsWidgetDialogEngine that will be used as default engine by the QSettingsDialog for dialog creation. The most important part of this engine are it's add/registery functions, that allow you to define custom edit widgets and group widgets.
The following diagramm describes the Dialog-UI structure. Bold classes are the most important ones for you as an api user:
The core can be found in any of the default examples, but all of it's features are tested out in the EngineTest and the VariantWidgetsTest. Use these examples if you interested in all the feature of the Dialog-UI.
#define REGISTER_FLAG_CONVERTERS | ( | FlagsType | ) | REGISTER_TYPE_CONVERTERS(FlagsType, int) |
A macro to register flag types.
FlagsType | The custom QFlags class that should have it's converters registered |
This macro will use REGISTER_TYPE_CONVERTERS to make it possible to convert your custom flags from and to int
. This is required if you want to use the flags type with the QSettingsDialog!
#define REGISTER_TYPE_CONVERTERS | ( | TypeA, | |
TypeB | |||
) |
A macro for type converter registration.
TypeA | The first, custom type that provides the converters |
TypeB | the second, less complex type, that serves as "target" of these converters |
This macro can be used to register simple type converters for QVariant. This may be required for some types to make it possible to use them with edit widgets.
Simple example: You defined your own class SuperInt
. To edit it, you use a spinbox. Now since the spinbox uses int
as a type, you need to convert these types. First step is to create conversion functionality in SuperInt
. You will need a constructor from int
and a conversion operator to int
:
Next step is to register the converter using this macro. You do this in your main
after you have create the QApplication
:
Thats it. Now QVariant
is able to internally convert these two types into each other, which makes it possible to do for example this: