edbee - Qt Editor Library
|
A cascading map is a Hierarchical QVariantMap. More...
#include <cascadingqvariantmap.h>
Public Member Functions | |
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. More... | |
void | setQVariantMap (const QVariantMap &map) |
Sets the variant mapt to the given map. More... | |
CascadingQVariantMap * | root () |
This method finds the 'root variant map. More... | |
CascadingQVariantMap * | parent () const |
Returns the parent of this map. More... | |
void | insert (const QString &key, const QVariant &value) |
Insert the given value at the current cascading level. More... | |
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. More... | |
const QString | stringValue (const QString &key, const QString &defValue=QString()) const |
Method to quickly fetch a string item. More... | |
int | intValue (const QString &key, int defValue=0) const |
Method to quickly fetch int items. More... | |
double | doubleValue (const QString &key, double defValue=0.0) const |
Returns a double value. More... | |
bool | boolValue (const QString &key, bool defValue=false) const |
Returns the default boolean value. More... | |
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
|
explicit |
bool edbee::CascadingQVariantMap::boolValue | ( | const QString & | key, |
bool | defValue = false |
||
) | const |
Returns the default boolean value.
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.
double edbee::CascadingQVariantMap::doubleValue | ( | const QString & | key, |
double | defValue = 0.0 |
||
) | const |
Returns a double value.
void edbee::CascadingQVariantMap::insert | ( | const QString & | key, |
const QVariant & | value | ||
) |
Insert the given value at the current cascading level.
key | the name of the key to set |
value | the value to set |
int edbee::CascadingQVariantMap::intValue | ( | const QString & | key, |
int | defValue = 0 |
||
) | const |
Method to quickly fetch int items.
CascadingQVariantMap * edbee::CascadingQVariantMap::parent | ( | ) | const |
Returns the parent of this map.
CascadingQVariantMap * edbee::CascadingQVariantMap::root | ( | ) |
This method finds the 'root variant map.
void edbee::CascadingQVariantMap::setQVariantMap | ( | const QVariantMap & | map | ) |
Sets the variant mapt to the given map.
const QString edbee::CascadingQVariantMap::stringValue | ( | const QString & | key, |
const QString & | defValue = QString() |
||
) | const |
Method to quickly fetch a string item.
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.
key | the name of the item to retrieve |
defValue | the default value when the item isn't found |