ctkDoubleSlider.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Library:   CTK
00004  
00005   Copyright (c) 2010  Kitware Inc.
00006 
00007   Licensed under the Apache License, Version 2.0 (the "License");
00008   you may not use this file except in compliance with the License.
00009   You may obtain a copy of the License at
00010 
00011       http://www.commontk.org/LICENSE
00012 
00013   Unless required by applicable law or agreed to in writing, software
00014   distributed under the License is distributed on an "AS IS" BASIS,
00015   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016   See the License for the specific language governing permissions and
00017   limitations under the License.
00018  
00019 =========================================================================*/
00020 
00021 #ifndef __ctkDoubleSlider_h
00022 #define __ctkDoubleSlider_h
00023 
00024 // Qt includes
00025 #include <QSlider>
00026 #include <QWidget>
00027 
00028 // CTK includes
00029 #include <ctkPimpl.h>
00030 #include "CTKWidgetsExport.h"
00031 
00032 class ctkDoubleSliderPrivate;
00033 
00034 class CTK_WIDGETS_EXPORT ctkDoubleSlider : public QWidget
00035 {
00036   Q_OBJECT
00037   Q_PROPERTY(double value READ value WRITE setValue)
00038   Q_PROPERTY(double sliderPosition READ sliderPosition WRITE setSliderPosition)
00039   Q_PROPERTY(double singleStep READ singleStep WRITE setSingleStep)
00040   Q_PROPERTY(double minimum READ minimum WRITE setMinimum)
00041   Q_PROPERTY(double maximum READ maximum WRITE setMaximum)
00042   Q_PROPERTY(double tickInterval READ tickInterval WRITE setTickInterval)
00043   Q_PROPERTY(bool tracking READ hasTracking WRITE setTracking)
00044   Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
00045 
00046 public:
00048   typedef QWidget Superclass;
00049 
00053   explicit ctkDoubleSlider(QWidget* parent = 0);
00054   explicit ctkDoubleSlider(Qt::Orientation orient, QWidget* parent = 0);
00056   virtual ~ctkDoubleSlider();
00057 
00063   void setMinimum(double min);
00064   double minimum()const;
00065 
00071   void setMaximum(double max);
00072   double maximum()const;
00073 
00077   void setRange(double min, double max);
00078 
00084   double value()const;
00085 
00090   void setSingleStep(double step);
00091   double singleStep()const;
00092 
00098   void setTickInterval(double ti);
00099   double tickInterval()const;
00100 
00104   double sliderPosition()const;
00105   void setSliderPosition(double);
00106 
00113   void setTracking(bool enable);
00114   bool hasTracking()const;
00115   
00120   void triggerAction(QAbstractSlider::SliderAction action);
00121 
00125   Qt::Orientation orientation()const;
00126 
00127 public slots:
00133   void setValue(double value);
00134 
00138   void setOrientation(Qt::Orientation orientation);
00139 
00140 protected slots:
00141   void onValueChanged(int value);
00142   void onSliderMoved(int position);
00143 
00144 signals:
00148   void valueChanged(double value);
00149 
00155   void sliderMoved(double position);
00156   
00160   void sliderPressed();
00161   
00165   void sliderReleased();
00166   
00167 private:
00168   CTK_DECLARE_PRIVATE(ctkDoubleSlider);
00169 };
00170 
00171 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines