Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkNumberPropertySlider.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 QmitkNumberPropertySliderhincludecd
17 #define QmitkNumberPropertySliderhincludecd
18 
20 
21 #include <QSlider>
22 
23 #include <memory>
24 
25 namespace mitk
26 {
27  class IntProperty;
28  class FloatProperty;
29  class DoubleProperty;
30 }
31 
34 {
35  Q_OBJECT
36  Q_PROPERTY(short decimalPlaces READ getDecimalPlaces WRITE setDecimalPlaces)
37  Q_PROPERTY(bool showPercent READ getShowPercent WRITE setShowPercent)
38  Q_PROPERTY(int minValue READ minValue WRITE setMinValue)
39  Q_PROPERTY(int maxValue READ maxValue WRITE setMaxValue)
40 
41 public:
42  QmitkNumberPropertySlider(QWidget *parent = nullptr);
43  virtual ~QmitkNumberPropertySlider();
44 
45  void SetProperty(mitk::IntProperty *property);
46  void SetProperty(mitk::FloatProperty *property);
47  void SetProperty(mitk::DoubleProperty *property);
48 
49  short getDecimalPlaces() const;
50  void setDecimalPlaces(short);
51 
52  bool getShowPercent() const;
53  void setShowPercent(bool);
54 
55  int minValue() const;
56  void setMinValue(int);
57  int maxValue() const;
58  void setMaxValue(int);
59  double doubleValue() const;
60  void setDoubleValue(double);
61 
62 protected slots:
63 
64  void onValueChanged(int);
65 
66 private:
67  class Impl;
68  std::unique_ptr<Impl> d;
69 };
70 
71 #endif
#define MITKQTWIDGETSEXT_EXPORT
STL namespace.
DataCollection - Class to facilitate loading/accessing structured data.