Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 #ifndef QmitkNumberPropertySlider_h
13 #define QmitkNumberPropertySlider_h
14 
16 
17 #include <QSlider>
18 
19 #include <memory>
20 
21 namespace mitk
22 {
23  class IntProperty;
24  class FloatProperty;
25  class DoubleProperty;
26 }
27 
30 {
31  Q_OBJECT
32  Q_PROPERTY(short decimalPlaces READ getDecimalPlaces WRITE setDecimalPlaces)
33  Q_PROPERTY(bool showPercent READ getShowPercent WRITE setShowPercent)
34  Q_PROPERTY(int minValue READ minValue WRITE setMinValue)
35  Q_PROPERTY(int maxValue READ maxValue WRITE setMaxValue)
36 
37 public:
38  QmitkNumberPropertySlider(QWidget *parent = nullptr);
39  ~QmitkNumberPropertySlider() override;
40 
41  void SetProperty(mitk::IntProperty *property);
42  void SetProperty(mitk::FloatProperty *property);
43  void SetProperty(mitk::DoubleProperty *property);
44 
45  short getDecimalPlaces() const;
46  void setDecimalPlaces(short);
47 
48  bool getShowPercent() const;
49  void setShowPercent(bool);
50 
51  int minValue() const;
52  void setMinValue(int);
53  int maxValue() const;
54  void setMaxValue(int);
55  double doubleValue() const;
56  void setDoubleValue(double);
57 
58 protected slots:
59 
60  void onValueChanged(int);
61 
62 private:
63  class Impl;
64  std::unique_ptr<Impl> d;
65 };
66 
67 #endif
MITKQTWIDGETSEXT_EXPORT
#define MITKQTWIDGETSEXT_EXPORT
Definition: MitkQtWidgetsExtExports.h:15
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
QmitkNumberPropertySlider
Definition: QmitkNumberPropertySlider.h:29
MitkQtWidgetsExtExports.h