|
Krita Source Code Documentation
|
#include <KoProperties.h>
Inheritance diagram for KoProperties:Public Member Functions | |
| bool | boolProperty (const QString &name, bool defaultValue=false) const |
| bool | contains (const QString &key) const |
| qreal | doubleProperty (const QString &name, qreal defaultValue=0.0) const |
| int | intProperty (const QString &name, int defaultValue=0) const |
| bool | isEmpty () const |
| KoProperties () | |
| KoProperties (const KoProperties &other) | |
| void | load (const QDomElement &root) |
| bool | load (const QString &string) |
| bool | operator== (const KoProperties &other) const |
| QVariant | property (const QString &name) const |
| bool | property (const QString &name, QVariant &value) const |
| QMapIterator< QString, QVariant > | propertyIterator () const |
| void | save (QDomElement &root) const |
| void | setProperty (const QString &name, const QVariant &value) |
| QString | store (const QString &root) const |
| Create a serialized version of these properties (as XML) with root as the root element. | |
| QString | stringProperty (const QString &name, const QString &defaultValue=QString()) const |
| QVariant | value (const QString &key) const |
| ~KoProperties () | |
Public Attributes | |
| QMap< QString, QVariant > | properties |
Private Attributes | |
| Private *const | d |
Private Attributes inherited from Private | |
| KisCanvas2 * | canvas |
| int | displayedFrame |
| int | intendedFrame |
Additional Inherited Members | |
Private Member Functions inherited from Private | |
| Private (KisCanvas2 *c) | |
A KoProperties is the (de-)serializable representation of a key-value map. The serialisation format is XML.
Definition at line 14 of file KoProperties.cpp.
| KoProperties::KoProperties | ( | ) |
Create a new properties object
Definition at line 20 of file KoProperties.cpp.
| KoProperties::KoProperties | ( | const KoProperties & | other | ) |
| KoProperties::~KoProperties | ( | ) |
| bool KoProperties::boolProperty | ( | const QString & | name, |
| bool | defaultValue = false ) const |
Return a boolean property by name.
| name | the name (or key) with which the variant was registered. |
| defaultValue | the default value, should there not be any property by the name this will be returned. |
Definition at line 154 of file KoProperties.cpp.
References property(), and v.
| bool KoProperties::contains | ( | const QString & | key | ) | const |
Returns true if the specified key is present in this properties object.
Definition at line 172 of file KoProperties.cpp.
References d.
| qreal KoProperties::doubleProperty | ( | const QString & | name, |
| qreal | defaultValue = 0.0 ) const |
Return a qreal property by name.
| name | the name (or key) with which the variant was registered. |
| defaultValue | the default value, should there not be any property by the name this will be returned. |
Definition at line 145 of file KoProperties.cpp.
References property(), and v.
| int KoProperties::intProperty | ( | const QString & | name, |
| int | defaultValue = 0 ) const |
Return an integer property by name. A typical usage:
| name | the name (or key) with which the variant was registered. |
| defaultValue | the default value, should there not be any property by the name this will be returned. |
Definition at line 135 of file KoProperties.cpp.
References property(), and v.
| bool KoProperties::isEmpty | ( | ) | const |
Definition at line 42 of file KoProperties.cpp.
References d.
| void KoProperties::load | ( | const QDomElement & | root | ) |
Fill the properties object from the XML dom node.
load() does not touch existing properties if loading fails.
| root | the root node of the properties subtree. |
Definition at line 47 of file KoProperties.cpp.
| bool KoProperties::load | ( | const QString & | string | ) |
Fill the properties object from the XML encoded representation in string.
load() does not touch existing properties if loading fails.
| string | the stored properties. |
Definition at line 72 of file KoProperties.cpp.
References load().
| bool KoProperties::operator== | ( | const KoProperties & | other | ) | const |
Definition at line 182 of file KoProperties.cpp.
References d.
| QVariant KoProperties::property | ( | const QString & | name | ) | const |
Return a property by name, wrapped in a QVariant. A typical usage:
| name | the name (or key) with which the variant was registered. |
Definition at line 129 of file KoProperties.cpp.
References d.
| bool KoProperties::property | ( | const QString & | name, |
| QVariant & | value ) const |
Set value to the value associated with property name
Definition at line 118 of file KoProperties.cpp.
| QMapIterator< QString, QVariant > KoProperties::propertyIterator | ( | ) | const |
Returns an iterator over the properties. The iterator is not suitable for adding or removing properties.
Definition at line 36 of file KoProperties.cpp.
References d.
| void KoProperties::save | ( | QDomElement & | root | ) | const |
Definition at line 83 of file KoProperties.cpp.
| void KoProperties::setProperty | ( | const QString & | name, |
| const QVariant & | value ) |
| QString KoProperties::store | ( | const QString & | root | ) | const |
Create a serialized version of these properties (as XML) with root as the root element.
| root | as the root element in the generated XML. |
Definition at line 102 of file KoProperties.cpp.
References save().
| QString KoProperties::stringProperty | ( | const QString & | name, |
| const QString & | defaultValue = QString() ) const |
Return an QString property by name. A typical usage:
| name | the name (or key) with which the variant was registered. |
| defaultValue | the default value, should there not be any property by the name this will be returned. |
Definition at line 163 of file KoProperties.cpp.
References property(), and v.
| QVariant KoProperties::value | ( | const QString & | key | ) | const |
Returns the value associated with the specified key if this properties object contains the specified key; otherwise return an empty QVariant.
Definition at line 177 of file KoProperties.cpp.
References d.
|
private |
Definition at line 168 of file KoProperties.h.
| QMap<QString, QVariant> KoProperties::properties |
Definition at line 17 of file KoProperties.cpp.