Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmlMitkSliderNavigatorItem.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 
17 #ifndef __QmlMitkSliderNavigatorItem_h
18 #define __QmlMitkSliderNavigatorItem_h
19 
20 #include "MitkQmlItemsExports.h"
21 #include <mitkStepper.h>
22 #include <QQuickItem>
23 #include <QString>
24 
26 {
27  Q_OBJECT
28  Q_PROPERTY(double min READ getMin WRITE setMin NOTIFY minChanged);
29  Q_PROPERTY(double max READ getMax WRITE setMax NOTIFY maxChanged);
30  Q_PROPERTY(double value READ getValue WRITE setValue NOTIFY valueChanged);
31 
32 private:
33  double m_Min;
34  double m_Max;
35  double m_Value;
36 
37 public:
38  QmlMitkSliderNavigatorItem(QQuickItem* parent = nullptr);
39 
40  void setMin(double min);
41  void setMax(double max);
42  void setValue(double value);
43 
44  double getMin();
45  double getMax();
46  double getValue();
47 
48  QString GetLabelUnit();
49 
56  QString ClippedValueToString( float value );
57 
61  QString GetMinValueLabel();
62  QString GetMaxValueLabel();
63 
64  int GetPos();
65  static void create();
66 
67 public slots:
74  void Refetch();
75  void SetStepper( mitk::Stepper * stepper);
76  void ShowLabels( bool show );
77 
82  void ShowLabelUnit( bool show );
83  void SetPos(int val);
84  void SetInverseDirection (bool inverseDirection);
85 
86 protected slots:
91  void SetLabelValues( float min, float max );
92  void SetLabelValuesValid( bool minValid, bool maxValid );
93 
98  void SetLabelUnit( const char *unit );
99 
100 protected:
104  QString m_LabelUnit;
108  float m_MinValue;
109  float m_MaxValue;
111 signals:
112  void minChanged();
113  void maxChanged();
114  void valueChanged();
115  void sync();
116 };
117 
118 #endif
#define MITKQMLITEMS_EXPORT
static T max(T x, T y)
Definition: svm.cpp:70
static T min(T x, T y)
Definition: svm.cpp:67
Helper class to step through a list.
Definition: mitkStepper.h:51