Class Color#
Inherits the following classes: ValueHandler
Public Functions#
Type | Name |
---|---|
Color (QColor def) |
|
virtual bool | check (const QVariant & val) override Check the value semantically. |
virtual QString | expected () override The expected value (descriptive). Used when reporting configuration errors. |
virtual QVariant | fallback () override Fallback value (default value). |
virtual QVariant | process (const QVariant & val) override Process a value, presuming it is a valid QVariant . |
virtual QVariant | representation (const QVariant & val) override Return the representation of the value in the config file. |
Public Functions inherited from ValueHandler#
See ValueHandler
Type | Name |
---|---|
virtual bool | check (const QVariant & val) = 0 Check the value semantically. |
virtual QString | expected () The expected value (descriptive). Used when reporting configuration errors. |
virtual QVariant | fallback () Fallback value (default value). |
virtual QVariant | representation (const QVariant & val) Return the representation of the value in the config file. |
QVariant | value (const QVariant & val) Adapt the value for proper use. |
Protected Functions inherited from ValueHandler#
See ValueHandler
Type | Name |
---|---|
virtual QVariant | process (const QVariant & val) Process a value, presuming it is a valid QVariant . |
Public Functions Documentation#
function Color#
Color::Color (
QColor def
)
function check#
Check the value semantically.
virtual bool Color::check (
const QVariant & val
) override
Parameters:
val
The value that was read from the config file
Returns:
Whether the value is correct
Note:
The function should presume that val.isValid()
is true.
Implements ValueHandler::check
function expected#
virtual QString Color::expected () override
Implements ValueHandler::expected
function fallback#
virtual QVariant Color::fallback () override
Implements ValueHandler::fallback
function process#
Process a value, presuming it is a valid QVariant
.
virtual QVariant Color::process (
const QVariant & val
) override
Parameters:
val
The value that was read from the config file
Returns:
The processed value
Note:
You will usually want to override this. In rare cases, you may want to override value
.
Implements ValueHandler::process
function representation#
Return the representation of the value in the config file.
virtual QVariant Color::representation (
const QVariant & val
) override
Override this if you want to write the value in a different format than the one provided by QVariant
.
Implements ValueHandler::representation