This class describes a property object. More...
#include <PropertyObject.h>
Public Member Functions | |
virtual bool | addProperty (Property *) |
Tag a new CamiTK property to this object. More... | |
virtual unsigned int | getNumberOfProperties () const |
get the current number of property More... | |
virtual Q_INVOKABLE camitk::Property * | getProperty (QString name) |
Get a Property given its name. More... | |
virtual QString | getPropertyName (unsigned int index) const |
get the name of the property at the given index, null string if index is out of bounds (i.e., isNull() == true) More... | |
virtual QVariant | getPropertyValue (const QString name) |
conveniant method to get the value of a given property, returns a non valid QVariant if no property with that name exists More... | |
virtual QVariant | getPropertyValue (unsigned int index) |
get the value of the property at the given index, a non valid QVariant if the index is out of bounds (i.e., isValid() == false) More... | |
void | loadFromSettings (const QString &settingGroupName) |
initializes all property values from setting values found in the given group name More... | |
PropertyObject (QString name) | |
Default constructor. More... | |
virtual void | removeProperty (Property *) |
Remove a CamiTK property of this object. More... | |
void | saveToSettings (const QString &settingGroupName) |
save setting in the given group name using all the property values More... | |
~PropertyObject () override | |
Destructor. More... | |
Static Public Member Functions | |
static QString | toCamelCase (const QString &) |
utility method to transform property name to camel case. Quite useful to make sure all settings are stored as lowerCamelCase More... | |
Private Attributes | |
Property management | |
list of CamiTK properties decorating the object | |
QMap< QString, Property * > | propertiesMap |
This class describes a property object.
A property object is simply a QObject tagged with some CamiTK Properties The idea is to have an object which implements all the necessary methods to take advantages of the CamiTK Properties within the ObjectController
PropertyObject can be saved/loaded from settings. A typical use in this case is to
See the Application class for an example of a property object load/save to settings.
camitk::PropertyObject::PropertyObject | ( | QString | name | ) |
Default constructor.
name | The name of the PropertyObject instance. This one would be displayed in any SettingsDialog entries. |
|
override |
|
virtual |
Tag a new CamiTK property to this object.
If the property already exist, it will just change its value.
Referenced by PropertyExplorer::createProperties(), and camitk::Application::createProperties().
|
virtual |
get the current number of property
|
virtual |
Get a Property given its name.
name | the property name |
|
virtual |
get the name of the property at the given index, null string if index is out of bounds (i.e., isNull() == true)
|
virtual |
conveniant method to get the value of a given property, returns a non valid QVariant if no property with that name exists
|
virtual |
get the value of the property at the given index, a non valid QVariant if the index is out of bounds (i.e., isValid() == false)
Referenced by camitk::Action::setAutoUpdateProperties().
void camitk::PropertyObject::loadFromSettings | ( | const QString & | settingGroupName | ) |
initializes all property values from setting values found in the given group name
Referenced by camitk::Application::Application().
|
virtual |
Remove a CamiTK property of this object.
void camitk::PropertyObject::saveToSettings | ( | const QString & | settingGroupName | ) |
save setting in the given group name using all the property values
Referenced by camitk::Application::eventFilter().
|
static |
utility method to transform property name to camel case. Quite useful to make sure all settings are stored as lowerCamelCase
|
private |