summaryrefslogtreecommitdiff
path: root/src/zoomslider.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/zoomslider.h')
-rw-r--r--src/zoomslider.h55
1 files changed, 25 insertions, 30 deletions
diff --git a/src/zoomslider.h b/src/zoomslider.h
index 60b6772..a42e48d 100644
--- a/src/zoomslider.h
+++ b/src/zoomslider.h
@@ -24,50 +24,45 @@
* along with DrumGizmo; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#ifndef __DRUMGIZMO_ZOOMSLIDER_H__
-#define __DRUMGIZMO_ZOOMSLIDER_H__
+#pragma once
#include <QSlider>
#include <QObject>
-class ZoomSlider : public QSlider {
-Q_OBJECT
+class ZoomSlider
+ : public QSlider
+{
+ Q_OBJECT
public:
- ZoomSlider(Qt::Orientation orientation);
+ ZoomSlider(Qt::Orientation orientation);
- /**
- * Range of the slider. 'from' may be lesser than 'to' which will invert the
- * slider.
- */
- void setRange(float from, float to);
+ //! Range of the slider. 'from' may be lesser than 'to' which will invert the
+ //! slider.
+ void setRange(float from, float to);
- /**
- * Set the distance between emitting of valueChanged signals.
- * Example: from:=0, to:=1 and width:=0.5 will emit valueChanged signals on
- * 0.0, 0.5 and 1.0 (ie. the slider will have 3 actual values)
- * NOTE: If 'width' is greater than the span of [from; to] only the 'from'
- * and 'to' values can be selected on the slider.
- */
- void setTickWidth(float width);
-
- void setValue(float value);
+ //! Set the distance between emitting of valueChanged signals.
+ //! Example: from:=0, to:=1 and width:=0.5 will emit valueChanged signals on
+ //! 0.0, 0.5 and 1.0 (ie. the slider will have 3 actual values)
+ //! NOTE: If 'width' is greater than the span of [from; to] only the 'from'
+ //! and 'to' values can be selected on the slider.
+ void setTickWidth(float width);
+
+ void setValue(float value);
signals:
- void valueChanged(float value);
+ void valueChanged(float value);
private slots:
- void sliderValueChanged(int value);
+ void sliderValueChanged(int value);
protected:
- void paintEvent(QPaintEvent *ev);
+ void paintEvent(QPaintEvent* ev);
private:
- float fromSlider(int value);
+ float fromSlider(int value);
- bool inverted;
- float from;
- float to;
- float tick_width;
+ bool inverted;
+ float from;
+ float to;
+ float tick_width;
};
-
-#endif/*__DRUMGIZMO_ZOOMSLIDER_H__*/