A cascading map is a Hierarchical QVariantMap.
More...
#include <cascadingqvariantmap.h>
|
| CascadingQVariantMap (CascadingQVariantMap *parent=0) |
|
void | deleteParents () |
| This helper method deletes all containing parents recursively Tough this doesnt' feel quite correct (it uses references to parent) it makes managing the map a bit easier.
|
|
void | setQVariantMap (const QVariantMap &map) |
| Sets the variant mapt to the given map.
|
|
CascadingQVariantMap * | root () |
| This method finds the 'root variant map.
|
|
CascadingQVariantMap * | parent () const |
| Returns the parent of this map.
|
|
void | insert (const QString &key, const QVariant &value) |
| Insert the given value at the current cascading level.
|
|
const QVariant | value (const QString &key, const QVariant &defValue=QVariant()) const |
| Returns the value of the given key. If the map at this level doesn't have this key, it cascades to a higher-level. If it doesn't find the key if will fallback to the defValue supplied.
|
|
const QString | stringValue (const QString &key, const QString &defValue=QString()) const |
| Method to quickly fetch a string item.
|
|
int | intValue (const QString &key, int defValue=0) const |
| Method to quickly fetch int items.
|
|
double | doubleValue (const QString &key, double defValue=0.0) const |
| Returns a double value.
|
|
bool | boolValue (const QString &key, bool defValue=false) const |
| Returns the default boolean value.
|
|
A cascading map is a Hierarchical QVariantMap.
When retrieving an item, it fist tries to find the item at this level, if it does't find the item it tries the parent item
◆ CascadingQVariantMap()
◆ boolValue()
bool edbee::CascadingQVariantMap::boolValue |
( |
const QString & | key, |
|
|
bool | defValue = false ) const |
Returns the default boolean value.
◆ deleteParents()
void edbee::CascadingQVariantMap::deleteParents |
( |
| ) |
|
This helper method deletes all containing parents recursively Tough this doesnt' feel quite correct (it uses references to parent) it makes managing the map a bit easier.
◆ doubleValue()
double edbee::CascadingQVariantMap::doubleValue |
( |
const QString & | key, |
|
|
double | defValue = 0.0 ) const |
◆ insert()
void edbee::CascadingQVariantMap::insert |
( |
const QString & | key, |
|
|
const QVariant & | value ) |
Insert the given value at the current cascading level.
- Parameters
-
key | the name of the key to set |
value | the value to set |
◆ intValue()
int edbee::CascadingQVariantMap::intValue |
( |
const QString & | key, |
|
|
int | defValue = 0 ) const |
Method to quickly fetch int items.
◆ parent()
Returns the parent of this map.
◆ root()
This method finds the 'root variant map.
◆ setQVariantMap()
void edbee::CascadingQVariantMap::setQVariantMap |
( |
const QVariantMap & | map | ) |
|
Sets the variant mapt to the given map.
◆ stringValue()
const QString edbee::CascadingQVariantMap::stringValue |
( |
const QString & | key, |
|
|
const QString & | defValue = QString() ) const |
Method to quickly fetch a string item.
◆ value()
const QVariant edbee::CascadingQVariantMap::value |
( |
const QString & | key, |
|
|
const QVariant & | defValue = QVariant() ) const |
Returns the value of the given key. If the map at this level doesn't have this key, it cascades to a higher-level. If it doesn't find the key if will fallback to the defValue supplied.
- Parameters
-
key | the name of the item to retrieve |
defValue | the default value when the item isn't found |
The documentation for this class was generated from the following files: