26#ifndef PROPERTYOBJECT_H
27#define PROPERTYOBJECT_H
65 saveToSettings("mySection")
68 See the Application class for an example of a property object load/save to settings.
70 * @see ObjectController, Property
143 virtual QVariant
toVariant()
const override;
146 virtual void fromVariant(
const QVariant&)
override;
149 virtual QUuid
getUuid()
const override;
152 virtual bool setUuid(QUuid)
override;
159 QMap<QString, Property*> propertiesMap;
#define CAMITK_API
Definition CamiTKAPI.h:66
Interface for all objects that should be serialized by the PersistenceManager.
Definition InterfacePersistence.h:38
virtual unsigned int getNumberOfProperties() const
get the current number of property
Definition PropertyObject.cpp:84
virtual void removeProperty(Property *)
Remove a CamiTK property of this object.
Definition PropertyObject.cpp:78
void saveToSettings(const QString &settingGroupName)
save setting in the given group name using all the property values
Definition PropertyObject.cpp:262
virtual Q_INVOKABLE const camitk::Property * getProperty(QString name) const
Get a Property given its name.
Definition PropertyObject.cpp:69
void loadFromSettings(const QString &settingGroupName)
initializes all property values from setting values found in the given group name
Definition PropertyObject.cpp:165
virtual bool addProperty(Property *)
Tag a new CamiTK property to this object.
Definition PropertyObject.cpp:60
static QString toCamelCase(const QString &)
utility method to transform property name to camel case. Quite useful to make sure all settings are s...
Definition PropertyObject.cpp:118
virtual bool setUuid(QUuid) override
Set the unique ID of the propertyObject (usually the uuid of the containing object).
Definition PropertyObject.cpp:151
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 ...
Definition PropertyObject.cpp:99
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....
Definition PropertyObject.cpp:89
virtual QUuid getUuid() const override
Get the unique ID of the propertyObject (usually the uuid of the containing object).
Definition PropertyObject.cpp:146
virtual QVariant toVariant() const override
Definition PropertyObject.cpp:130
virtual void fromVariant(const QVariant &) override
Load data from a QVariant to initialize the current object.
Definition PropertyObject.cpp:141
PropertyObject(QString name)
Default constructor.
Definition PropertyObject.cpp:43
This class describes a property that can be used in components and actions or any class that needs to...
Definition Property.h:306