GOFIGURE2  0.9.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ctkDoubleSlider.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.commontk.org/LICENSE
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 
21 #ifndef __ctkDoubleSlider_h
22 #define __ctkDoubleSlider_h
23 
24 // Qt includes
25 #include <QSlider>
26 #include <QWidget>
27 
28 // CTK includes
29 #include <ctkPimpl.h>
30 #include "ctkConfigure.h"
31 
33 
42 class ctk_EXPORT ctkDoubleSlider : public QWidget
43 {
44  Q_OBJECT
45  Q_PROPERTY(double value READ value WRITE setValue)
46  Q_PROPERTY(double sliderPosition READ sliderPosition WRITE setSliderPosition)
47  Q_PROPERTY(double singleStep READ singleStep WRITE setSingleStep)
48  Q_PROPERTY(double minimum READ minimum WRITE setMinimum)
49  Q_PROPERTY(double maximum READ maximum WRITE setMaximum)
50  Q_PROPERTY(double tickInterval READ tickInterval WRITE setTickInterval)
51  Q_PROPERTY(bool tracking READ hasTracking WRITE setTracking)
52  Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
53 
54 public:
57 
60  explicit ctkDoubleSlider(QWidget* parent = 0);
63  explicit ctkDoubleSlider(Qt::Orientation orient, QWidget* parent = 0);
65  virtual ~ctkDoubleSlider();
66 
72  void setMinimum(double min);
73  double minimum()const;
74 
80  void setMaximum(double max);
81  double maximum()const;
82 
86  void setRange(double min, double max);
87 
93  double value()const;
94 
99  void setSingleStep(double step);
100  double singleStep()const;
101 
107  void setTickInterval(double ti);
108  double tickInterval()const;
109 
113  double sliderPosition()const;
114  void setSliderPosition(double);
115 
122  void setTracking(bool enable);
123  bool hasTracking()const;
124 
129  void triggerAction(QAbstractSlider::SliderAction action);
130 
134  Qt::Orientation orientation()const;
135 
136 public slots:
142  void setValue(double value);
143 
147  void setOrientation(Qt::Orientation orientation);
148 
149 signals:
153  void valueChanged(double value);
154 
160  void sliderMoved(double position);
161 
165  void sliderPressed();
166 
170  void sliderReleased();
171 
177  void rangeChanged(double min, double max);
178 
179 protected slots:
180  void onValueChanged(int value);
181  void onSliderMoved(int position);
182  void onRangeChanged(int min, int max);
183 
184 protected:
186 
187 private:
188  Q_DECLARE_PRIVATE(ctkDoubleSlider);
189  Q_DISABLE_COPY(ctkDoubleSlider);
190 };
191 
192 #endif