Computer Assited Medical Intervention Tool Kit  version 5.0
Property.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 PROPERTY_H
27 #define PROPERTY_H
28 
29 #include <QVariant>
30 #include <QStringList>
31 #include <QIcon>
32 
33 #include "CamiTKAPI.h"
34 
35 namespace camitk {
36 
280 class CAMITK_API Property {
281 
282 public:
291  Property(QString name, const QVariant& variant, QString description, QString unit);
292 
294  virtual ~Property() = default;
295 
297  const QString& getName() const;
298 
300  const QVariant& getInitialValue() const;
301 
303  void setReadOnly(bool);
304 
306  bool getReadOnly() const;
307 
309  void setDescription(QString);
310 
312  const QString& getDescription() const;
313 
328  void setAttribute(const QString& attribute, const QVariant& value);
329 
341  QVariant getAttribute(QString attName);
342 
344  QStringList getAttributeList();
345 
349  void setEnumTypeName(QString);
350 
360  void setEnumTypeName(QString enumTypeName, QObject* objectDeclaringTheEnum);
361 
363  QString getEnumTypeName() const;
364 
372  QString getEnumValueAsString(const QObject* objectDeclaringTheEnum) const;
373 
375  QMap<int, QIcon> getEnumIcons() const;
376 
378  void setEnumIcons(const QMap<int, QIcon>& enumIcons);
379 
384  void setGroupName(QString groupName);
385 
389  QString getGroupName() const;
390 
391 private:
393  QString name;
394 
396  QString groupName;
397 
403  QVariant initialValue;
404 
406  QString description;
407 
409  bool readOnly;
410 
412  QMap<QString, QVariant> attributeValues;
413 
415  QString enumTypeName;
416 
418  QMap<int, QIcon> enumIcons;
419 };
420 
421 }
422 
423 #endif // PROPERTY_H
camitk::Property::Property
Property(QString name, const QVariant &variant, QString description, QString unit)
Constructor.
Definition: Property.cpp:56
CamiTKAPI.h
Property.h
description
const char * description
Definition: applications/cepgenerator/main.cpp:38
CAMITK_API
#define CAMITK_API
Definition: CamiTKAPI.h:49
camitk
Definition: Action.cpp:35