1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
3
* Copyright (C) 1997 Josef Wilgen
4
* Copyright (C) 2002 Uwe Rathmann
6
* This library is free software; you can redistribute it and/or
7
* modify it under the terms of the Qwt License, Version 1.0
8
*****************************************************************************/
15
#include "qwt_global.h"
16
#include "qwt_abstract_scale.h"
17
#include "qwt_abstract_slider.h"
22
\brief The Slider Widget
24
QwtSlider is a slider widget which operates on an interval
25
of type double. QwtSlider supports different layouts as
28
\image html sliders.png
30
\sa QwtAbstractSlider and QwtAbstractScale for the descriptions
31
of the inherited members.
34
class QWT_EXPORT QwtSlider : public QwtAbstractSlider, public QwtAbstractScale
39
Q_PROPERTY( ScalePos scalePosition READ scalePosition
40
WRITE setScalePosition )
41
Q_PROPERTY( BGSTYLE bgStyle READ bgStyle WRITE setBgStyle )
42
Q_PROPERTY( int thumbLength READ thumbLength WRITE setThumbLength )
43
Q_PROPERTY( int thumbWidth READ thumbWidth WRITE setThumbWidth )
44
Q_PROPERTY( int borderWidth READ borderWidth WRITE setBorderWidth )
49
Scale position. QwtSlider tries to enforce valid combinations of its
50
orientation and scale position:
51
- Qt::Horizonal combines with NoScale, TopScale and BottomScale
52
- Qt::Vertical combines with NoScale, LeftScale and RightScale
54
\sa QwtSlider::QwtSlider
68
\sa QwtSlider::QwtSlider
74
BgBoth = BgTrough | BgSlot
77
explicit QwtSlider(QWidget *parent,
78
Qt::Orientation = Qt::Horizontal,
79
ScalePos = NoScale, BGSTYLE bgStyle = BgTrough);
80
#if QT_VERSION < 0x040000
81
explicit QwtSlider(QWidget *parent, const char *name);
86
virtual void setOrientation(Qt::Orientation);
88
void setBgStyle(BGSTYLE);
89
BGSTYLE bgStyle() const;
91
void setScalePosition(ScalePos s);
92
ScalePos scalePosition() const;
94
int thumbLength() const;
95
int thumbWidth() const;
96
int borderWidth() const;
98
void setThumbLength(int l);
99
void setThumbWidth(int w);
100
void setBorderWidth(int bw);
101
void setMargins(int x, int y);
103
virtual QSize sizeHint() const;
104
virtual QSize minimumSizeHint() const;
106
void setScaleDraw(QwtScaleDraw *);
107
const QwtScaleDraw *scaleDraw() const;
110
virtual double getValue(const QPoint &p);
111
virtual void getScrollMode(const QPoint &p,
112
int &scrollMode, int &direction);
114
void draw(QPainter *p, const QRect& update_rect);
115
virtual void drawSlider (QPainter *p, const QRect &r);
116
virtual void drawThumb(QPainter *p, const QRect &, int pos);
118
virtual void resizeEvent(QResizeEvent *e);
119
virtual void paintEvent (QPaintEvent *e);
121
virtual void valueChange();
122
virtual void rangeChange();
123
virtual void scaleChange();
124
virtual void fontChange(const QFont &oldFont);
126
void layoutSlider( bool update = true );
127
int xyPosition(double v) const;
129
QwtScaleDraw *scaleDraw();
132
void initSlider(Qt::Orientation, ScalePos scalePos, BGSTYLE bgStyle);