Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxBoolPropertyBase.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXBOOLPROPERTYBASE_H_
13 #define CXBOOLPROPERTYBASE_H_
14 
15 #include "cxResourceExport.h"
16 
17 #include "cxProperty.h"
18 
19 namespace cx
20 {
21 
26 class cxResource_EXPORT BoolPropertyBase: public Property
27 {
28 Q_OBJECT
29 public:
31  {
32  }
33 
34 public:
35  // basic methods
36  virtual QString getDisplayName() const = 0;
37  virtual bool setValue(bool value) = 0;
38  virtual bool getValue() const = 0;
39 
40  virtual QVariant getValueAsVariant() const
41  {
42  return QVariant(this->getValue());
43  }
44  virtual void setValueFromVariant(QVariant val)
45  {
46  this->setValue(val.toBool());
47  }
48 
49 public:
50  // optional methods
51  virtual QString getHelp() const
52  {
53  return QString();
54  }
55  //virtual void connectValueSignals(bool on) {} ///< set object to emit changed() when applicable
56 
57  //signals:
58  // void changed(); ///< emit when the underlying data value is changed: The user interface will be updated.
59 };
60 typedef boost::shared_ptr<BoolPropertyBase> BoolPropertyBasePtr;
61 
62 }
63 
64 #endif /* CXBOOLPROPERTYBASE_H_ */
Superclass for all data adapters.
Definition: cxProperty.h:43
boost::shared_ptr< class BoolPropertyBase > BoolPropertyBasePtr
virtual QVariant getValueAsVariant() const
virtual QString getHelp() const
return a descriptive help string for the data, used for example as a tool tip.
virtual void setValueFromVariant(QVariant val)
Namespace for all CustusX production code.