Computer Assited Medical Intervention Tool Kit  version 5.0
PropertyObject.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, TIMC, 38000 Grenoble, France
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef PROPERTYOBJECT_H
27 #define PROPERTYOBJECT_H
28 
29 // Qt includes
30 #include <QObject>
31 
32 // CamiTK includes
33 #include "CamiTKAPI.h"
34 #include "Property.h"
35 
36 namespace camitk {
37 
64 
71 class CAMITK_API PropertyObject : public QObject {
72 
73  Q_OBJECT
74 
75 public:
80  PropertyObject(QString name);
81 
83  ~PropertyObject() override;
84 
95  virtual bool addProperty(Property*);
96 
107  Q_INVOKABLE virtual camitk::Property* getProperty(QString name);
108 
112  virtual void removeProperty(Property*);
113 
115  virtual unsigned int getNumberOfProperties() const;
116 
118  virtual QString getPropertyName(unsigned int index) const;
119 
121  virtual QVariant getPropertyValue(unsigned int index);
122 
124  virtual QVariant getPropertyValue(const QString name);
125 
127  void loadFromSettings(const QString& settingGroupName);
128 
130  void saveToSettings(const QString& settingGroupName);
131 
133  static QString toCamelCase(const QString&);
134 
135 private:
139  QMap<QString, Property*> propertiesMap;
141 };
142 
143 }
144 
145 #endif // PROPERTYOBJECT_H
CamiTKAPI.h
PropertyObject.h
camitk::PropertyObject::PropertyObject
PropertyObject(QString name)
Default constructor.
Definition: PropertyObject.cpp:62
camitk::Property
This class describes a property that can be used in components and actions or any class that needs to...
Definition: Property.h:303
camitk::Property::getName
const QString & getName() const
get the name of the property
Definition: Property.cpp:72
Property.h
camitk::setObjectName
setObjectName("RendererWidget")
Application.h
CAMITK_API
#define CAMITK_API
Definition: CamiTKAPI.h:49
camitk
Definition: Action.cpp:35