qCTKDoubleSlider.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Library:   qCTK
00004 
00005   Copyright (c) Kitware Inc. 
00006   All rights reserved.
00007   Distributed under a BSD License. See LICENSE.txt file.
00008 
00009   This software is distributed "AS IS" WITHOUT ANY WARRANTY; without even
00010   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00011   See the above copyright notice for more information.
00012 
00013 =========================================================================*/
00014 
00015 #ifndef __qCTKDoubleSlider_h
00016 #define __qCTKDoubleSlider_h
00017 
00019 #include <QSlider>
00020 #include <QWidget>
00021 
00023 #include "qCTKPimpl.h"
00024 #include "qCTKWidgetsExport.h"
00025 
00026 class qCTKDoubleSliderPrivate;
00027 
00028 class QCTK_WIDGETS_EXPORT qCTKDoubleSlider : public QWidget
00029 {
00030   Q_OBJECT
00031   Q_PROPERTY(double value READ value WRITE setValue)
00032   Q_PROPERTY(double sliderPosition READ sliderPosition WRITE setSliderPosition)
00033   Q_PROPERTY(double singleStep READ singleStep WRITE setSingleStep)
00034   Q_PROPERTY(double minimum READ minimum WRITE setMinimum)
00035   Q_PROPERTY(double maximum READ maximum WRITE setMaximum)
00036   Q_PROPERTY(double tickInterval READ tickInterval WRITE setTickInterval)
00037   Q_PROPERTY(bool tracking READ hasTracking WRITE setTracking)
00038   Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
00039 
00040 public:
00042   typedef QWidget Superclass;
00043 
00047   explicit qCTKDoubleSlider(QWidget* parent = 0);
00048   explicit qCTKDoubleSlider(Qt::Orientation orient, QWidget* parent = 0);
00050   virtual ~qCTKDoubleSlider();
00051 
00057   void setMinimum(double min);
00058   double minimum()const;
00059 
00065   void setMaximum(double max);
00066   double maximum()const;
00067 
00071   void setRange(double min, double max);
00072 
00078   double value()const;
00079 
00084   void setSingleStep(double step);
00085   double singleStep()const;
00086 
00092   void setTickInterval(double ti);
00093   double tickInterval()const;
00094 
00098   double sliderPosition()const;
00099   void setSliderPosition(double);
00100 
00107   void setTracking(bool enable);
00108   bool hasTracking()const;
00109   
00114   void triggerAction(QAbstractSlider::SliderAction action);
00115 
00119   Qt::Orientation orientation()const;
00120 
00121 public slots:
00127   void setValue(double value);
00128 
00132   void setOrientation(Qt::Orientation orientation);
00133 
00134 protected slots:
00135   void onValueChanged(int value);
00136   void onSliderMoved(int position);
00137 
00138 signals:
00142   void valueChanged(double value);
00143 
00149   void sliderMoved(double position);
00150   
00154   void sliderPressed();
00155   
00159   void sliderReleased();
00160   
00161 private:
00162   QCTK_DECLARE_PRIVATE(qCTKDoubleSlider);
00163 };
00164 
00165 #endif

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1