Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkNumberPropertyView.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 #ifndef QMITK_NUMBERPROPERTYVIEW_H_INCLUDED
17 #define QMITK_NUMBERPROPERTYVIEW_H_INCLUDED
18 
20 #include <QLabel>
21 #include <mitkProperties.h>
22 #include <mitkPropertyObserver.h>
23 
26 {
27  Q_OBJECT
28  Q_PROPERTY(short decimalPlaces READ decimalPlaces WRITE setDecimalPlaces)
29  Q_PROPERTY(QString suffix READ suffix WRITE setSuffix)
30  Q_PROPERTY(bool showPercent READ showPercent WRITE setShowPercent)
31 
32 public:
33  QmitkNumberPropertyView(const mitk::IntProperty *, QWidget *parent);
34  QmitkNumberPropertyView(const mitk::FloatProperty *, QWidget *parent);
35  QmitkNumberPropertyView(const mitk::DoubleProperty *, QWidget *parent);
36 
37  virtual ~QmitkNumberPropertyView();
38 
39  short decimalPlaces() const;
40  void setDecimalPlaces(short);
41 
42  QString suffix() const;
43  void setSuffix(const QString &);
44 
45  bool showPercent() const;
46  void setShowPercent(bool);
47 
48 protected:
49  void initialize();
50 
51  virtual void PropertyChanged() override;
52  virtual void PropertyRemoved() override;
53 
54  void DisplayNumber();
55 
56  union {
60  };
61 
62  const int m_DataType;
63 
65  QString m_Suffix;
67 };
68 
69 #endif
const mitk::GenericProperty< double > * m_DoubleProperty
#define MITKQTWIDGETSEXT_EXPORT
const mitk::GenericProperty< float > * m_FloatProperty
DataCollection - Class to facilitate loading/accessing structured data.
const mitk::GenericProperty< int > * m_IntProperty
QString m_Suffix
-1 indicates "no limit to decimal places"