#include <properties.h>
Inheritance diagram for Geddei::PropertiesInfo:
Public Member Functions | |
const QVariant & | defaultValue (const QString &key) const |
const QString | description (const QString &key) const |
const QStringList | keys () const |
PropertiesInfo & | operator() (const PropertiesInfo &merge) |
PropertiesInfo & | operator() (const QString &key, const QVariant defaultValue, const QString &description) |
PropertiesInfo () | |
PropertiesInfo (const QString &key, const QVariant defaultValue, const QString &description) | |
void | set (const QString &key, const QVariant defaultValue, const QString &description) |
void | set (const PropertiesInfo &merge) |
const uint | size () const |
Friends | |
class | Properties |
It comes with a nice inline construction mechanism to create instances with an unlimited number of tuples.
Geddei::PropertiesInfo::PropertiesInfo | ( | const QString & | key, | |
const QVariant | defaultValue, | |||
const QString & | description | |||
) | [inline] |
Constructor to create a PropertiesInfo object already populated with a tuple.
This can be utilised with the parentheses operator to construct objects with multiple tuples.
key | The name of the property the populated tuple will describe. | |
defaultValue | The default value this property will take. | |
description | A description of what this property means. |
Geddei::PropertiesInfo::PropertiesInfo | ( | ) | [inline] |
Basic constructor. Creates an empty Properties object.
const uint Geddei::PropertiesInfo::size | ( | ) | const [inline] |
Get the number of keys in this object.
Reimplemented from Geddei::Properties.
const QStringList Geddei::PropertiesInfo::keys | ( | ) | const [inline] |
Get a list of the keys in this object.
Reimplemented from Geddei::Properties.
void Geddei::PropertiesInfo::set | ( | const PropertiesInfo & | merge | ) | [inline] |
Inserts (or overwrites) a set of new tuples into this object.
Typical usage:
PropertiesInfo a, b; // a & b are populated... PropertiesInfo p; p.set(a); p.set(b); // p now contains all properties from a and b.
merge | The PropertiesInfo object from which to draw data. |
void Geddei::PropertiesInfo::set | ( | const QString & | key, | |
const QVariant | defaultValue, | |||
const QString & | description | |||
) | [inline] |
Inserts (or overwrites) a new tuple into this object.
key | The name of the property the new tuple will describe. | |
defaultValue | The default value this property will take. | |
description | A description of what this property means. |
const QVariant& Geddei::PropertiesInfo::defaultValue | ( | const QString & | key | ) | const [inline] |
Retrieve the default value for a given property.
key | The name of the property. |
const QString Geddei::PropertiesInfo::description | ( | const QString & | key | ) | const |
Retrieve the description of a given property.
key | The name of the property. |
PropertiesInfo& Geddei::PropertiesInfo::operator() | ( | const QString & | key, | |
const QVariant | defaultValue, | |||
const QString & | description | |||
) | [inline] |
Inserts (or overwrites) a new tuple into this object.
This should only be used in conjunction with the tuple constructor, since otherwise it can make code quite cryptic.
Typical usage:
PropertiesInfo p = PropertiesInfo("a", 1, "A's value") ("b", 2, "B's value");
It may be used similarly inline when calling methods with Properties arguments:
someObject.someMethod(PropertiesInfo("a", 1, "A's value") ("b", 2, "B's value"));
key | The name of the property the new tuple will describe. | |
defaultValue | The default value this property will take. | |
description | A description of what this property means. |
PropertiesInfo& Geddei::PropertiesInfo::operator() | ( | const PropertiesInfo & | merge | ) | [inline] |
Inserts (or overwrites) a set of new tuples into this object.
This should only be used in conjunction with the tuple constructor, since otherwise it can make code quite cryptic.
Typical usage:
PropertiesInfo a, b; // a & b are populated... PropertiesInfo p = PropertiesInfo(a)(b); // p now contains all properties from a and b.
merge | The PropertiesInfo object from which to draw data. |