QwtSlider(3)

NAME
QwtSlider -

SYNOPSIS

#include <qwt_slider.h>

Inherits QwtAbstractSlider, and QwtAbstractScale.

  Public Types
enum BackgroundStyle { Trough = 0x01, Groove = 0x02 }
typedef QFlags< BackgroundStyle > BackgroundStyles
enum ScalePos { NoScale, LeftScale, RightScale, TopScale, BottomScale }

  Public Member Functions
QwtSlider (QWidget *parent, Qt::Orientation=Qt::Horizontal, ScalePos=NoScale, BackgroundStyles=Trough)
BackgroundStyles backgroundStyle () const
int borderWidth () const
QSize handleSize () const
virtual QSize minimumSizeHint () const
const QwtScaleDraw * scaleDraw () const
ScalePos scalePosition () const
void setBackgroundStyle (BackgroundStyles)
void setBorderWidth (int bw)
void setHandleSize (int width, int height)
void setHandleSize (const QSize &)
virtual void setOrientation (Qt::Orientation)
void setScaleDraw (QwtScaleDraw *)
void setScalePosition (ScalePos s)
void setSpacing (int)
virtual QSize sizeHint () const
int spacing () const

  Protected Member Functions
virtual void changeEvent (QEvent *)
virtual void drawHandle (QPainter *, const QRect &, int pos) const
virtual void drawSlider (QPainter *, const QRect &) const
virtual void getScrollMode (const QPoint &p, QwtAbstractSlider::ScrollMode &, int &direction) const
virtual double getValue (const QPoint &p)
virtual void paintEvent (QPaintEvent *)
virtual void rangeChange ()
virtual void resizeEvent (QResizeEvent *)
virtual void scaleChange ()
QwtScaleDraw * scaleDraw ()
int transform (double v) const
virtual void valueChange ()

  Additional Inherited Members

Detailed Description

The Slider Widget. QwtSlider is a slider widget which operates on an interval of type double. QwtSlider supports different layouts as well as a scale.

See also:
    QwtAbstractSlider and QwtAbstractScale for the descriptions of the inherited members.

Member Enumeration Documentation

  enum QwtSlider::BackgroundStyle
Background style.

See also:
    QwtSlider()

Enumerator:

Trough
    Trough background.

Groove
    Groove.

  enum QwtSlider::ScalePos
Scale position. QwtSlider tries to enforce valid combinations of its orientation and scale position:

•   Qt::Horizonal combines with NoScale, TopScale and BottomScale

•   Qt::Vertical combines with NoScale, LeftScale and RightScale

See also:
    QwtSlider()

Enumerator:

NoScale
    The slider has no scale.

LeftScale
    The scale is left of the slider.

RightScale
    The scale is right of the slider.

TopScale
    The scale is above of the slider.

BottomScale
    The scale is below of the slider.

Constructor & Destructor Documentation

  QwtSlider::QwtSlider (QWidget *parent, Qt::Orientationorientation = Qt::Horizontal, ScalePosscalePos = NoScale, BackgroundStylesbgStyle = Trough) [explicit]

Constructor. Parameters:
    parent parent widget
    orientation Orientation of the slider. Can be Qt::Horizontal or Qt::Vertical. Defaults to Qt::Horizontal.
    scalePos Position of the scale. Defaults to QwtSlider::NoScale.
    bgStyle Background style. QwtSlider::Trough draws the slider button in a trough, QwtSlider::Slot draws a slot underneath the button. An or-combination of both may also be used. The default is QwtSlider::Trough.

QwtSlider enforces valid combinations of its orientation and scale position. If the combination is invalid, the scale position will be set to NoScale. Valid combinations are:

•   Qt::Horizonal with NoScale, TopScale, or BottomScale;

•   Qt::Vertical with NoScale, LeftScale, or RightScale.

Member Function Documentation

  QwtSlider::BackgroundStyles QwtSlider::backgroundStyle () const
Returns:
    the background style.

  int QwtSlider::borderWidth () const
Returns:
    the border width.

See also:
    setBorderWidth()

  void QwtSlider::drawHandle (QPainter *painter, const QRect &sliderRect, intpos) const [protected], [virtual]
Draw the thumb at a position

Parameters:
    painter Painter
    sliderRect Bounding rectangle of the slider
    pos Position of the slider thumb

  void QwtSlider::drawSlider (QPainter *painter, const QRect &sliderRect) const [protected], [virtual]
Draw the slider into the specified rectangle.

Parameters:
    painter Painter
    sliderRect Bounding rectangle of the slider

  void QwtSlider::getScrollMode (const QPoint &p, QwtAbstractSlider::ScrollMode &scrollMode, int &direction) const [protected], [virtual]

Determine scrolling mode and direction. Parameters:
    p point
    scrollMode Scrolling mode
    direction Direction

Implements QwtAbstractSlider.

  double QwtSlider::getValue (const QPoint &pos) [protected], [virtual]
Determine the value corresponding to a specified mouse location.

Parameters:
    pos Mouse position

Implements QwtAbstractSlider.

  QSize QwtSlider::handleSize () const
Returns:
    Size of the handle.

See also:
    setHandleSize()

  QSize QwtSlider::minimumSizeHint () const [virtual]

Return a minimum size hint. Warning:
    The return value of QwtSlider::minimumSizeHint() depends on the font and the scale.

  void QwtSlider::paintEvent (QPaintEvent *event) [protected], [virtual]
Qt paint event

Parameters:
    event Paint event

  const QwtScaleDraw * QwtSlider::scaleDraw () const
Returns:
    the scale draw of the slider

See also:
    setScaleDraw()

  QwtScaleDraw * QwtSlider::scaleDraw () [protected]
Returns:
    the scale draw of the slider

See also:
    setScaleDraw()

  void QwtSlider::setBackgroundStyle (BackgroundStylesstyle)
Set the background style.

  void QwtSlider::setBorderWidth (intwidth)

Change the slider's border width. Parameters:
    width Border width

  void QwtSlider::setHandleSize (intwidth, intheight)

Set the slider's handle size. Parameters:
    width Width
    height Height

See also:
    handleSize()

  void QwtSlider::setHandleSize (const QSize &size)

Set the slider's handle size. Parameters:
    size New size

See also:
    handleSize()

  void QwtSlider::setOrientation (Qt::Orientationo) [virtual]

Set the orientation. Parameters:
    o Orientation. Allowed values are Qt::Horizontal and Qt::Vertical.

If the new orientation and the old scale position are an invalid combination, the scale position will be set to QwtSlider::NoScale.

See also:
    QwtAbstractSlider::orientation()

Reimplemented from QwtAbstractSlider.

  void QwtSlider::setScaleDraw (QwtScaleDraw *scaleDraw)

Set a scale draw. For changing the labels of the scales, it is necessary to derive from QwtScaleDraw and overload QwtScaleDraw::label().

Parameters:
    scaleDraw ScaleDraw object, that has to be created with new and will be deleted in ~QwtSlider or the next call of setScaleDraw().

See also:
    scaleDraw()

  void QwtSlider::setScalePosition (ScalePosscalePos)

Change the scale position (and slider orientation). Parameters:
    scalePos Position of the scale.

A valid combination of scale position and orientation is enforced:

•   if the new scale position is Left or Right, the scale orientation will become Qt::Vertical;

•   if the new scale position is Bottom or Top the scale orientation will become Qt::Horizontal;

•   if the new scale position is QwtSlider::NoScale, the scale orientation will not change.

  void QwtSlider::setSpacing (intspacing)

Change the spacing between pipe and scale. A spacing of 0 means, that the backbone of the scale is below the trough.

The default setting is 4 pixels.

Parameters:
    spacing Number of pixels

See also:
    spacing();

  QSize QwtSlider::sizeHint () const [virtual]
Returns:
    QwtSlider::minimumSizeHint()

  int QwtSlider::spacing () const
Returns:
    Number of pixels between slider and scale

See also:
    setSpacing()

  int QwtSlider::transform (doublevalue) const [protected]
Map and round a value into widget coordinates

Parameters:
    value Value

Author

Generated automatically by Doxygen for Qwt User's Guide from the source code.