 |
Computer Assited Medical Intervention Tool Kit
version 4.1
|
Go to the documentation of this file.
26 #ifndef PROPERTYOBJECT_H
27 #define PROPERTYOBJECT_H
71 class CAMITK_API PropertyObject :
public QObject {
80 PropertyObject(QString name);
83 ~PropertyObject()
override;
95 virtual bool addProperty(Property*);
107 Q_INVOKABLE
virtual Property* getProperty(QString name);
112 virtual void removeProperty(Property*);
115 virtual unsigned int getNumberOfProperties()
const;
118 virtual QString getPropertyName(
unsigned int index)
const;
121 virtual QVariant getPropertyValue(
unsigned int index);
124 virtual QVariant getPropertyValue(
const QString name);
127 void loadFromSettings(
const QString& settingGroupName);
130 void saveToSettings(
const QString& settingGroupName);
133 static QString toCamelCase(
const QString&);
139 QMap<QString, Property*> propertiesMap;
145 #endif // PROPERTYOBJECT_H
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:129
static QSettings & getSettings()
Get the Core wide settings.
Definition: Application.cpp:300
void saveToSettings(const QString &settingGroupName)
save setting in the given group name using all the property values
Definition: PropertyObject.cpp:238
void loadFromSettings(const QString &settingGroupName)
initializes all property values from setting values found in the given group name
Definition: PropertyObject.cpp:141
PropertyObject(QString name)
Default constructor.
Definition: PropertyObject.cpp:61
virtual unsigned int getNumberOfProperties() const
get the current number of property
Definition: PropertyObject.cpp:95
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:312
const QString & getName() const
get the name of the property
Definition: Property.cpp:71
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:100
~PropertyObject() override
Destructor.
Definition: PropertyObject.cpp:66
QMap< QString, Property * > propertiesMap
Definition: PropertyObject.h:182
setObjectName("RendererWidget")
virtual void removeProperty(Property *)
Remove a CamiTK property of this object.
Definition: PropertyObject.cpp:89
virtual bool addProperty(Property *)
Tag a new CamiTK property to this object.
Definition: PropertyObject.cpp:75
virtual Q_INVOKABLE Property * getProperty(QString name)
Get a Property given its name.
Definition: PropertyObject.cpp:84
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:110
#define CAMITK_API
Definition: CamiTKAPI.h:48
Definition: Action.cpp:36