QwtSlider(3) | Qwt User's Guide | QwtSlider(3) |
NAME¶
QwtSlider -
SYNOPSIS¶
#include <qwt_slider.h>
Inherits QwtAbstractSlider, and QwtAbstractScale.
Public Types¶
enum BGSTYLE { BgTrough = 0x1, BgSlot = 0x2,
BgBoth = BgTrough | BgSlot }
enum ScalePos { NoScale, LeftScale, RightScale,
TopScale, BottomScale }
Public Member Functions¶
QwtSlider (QWidget *parent, Qt::Orientation=Qt::Horizontal,
ScalePos=NoScale, BGSTYLE bgStyle=BgTrough)
BGSTYLE bgStyle () const
int borderWidth () const
virtual QSize minimumSizeHint () const
const QwtScaleDraw * scaleDraw () const
ScalePos scalePosition () const
void setBgStyle (BGSTYLE)
void setBorderWidth (int bw)
void setMargins (int x, int y)
virtual void setOrientation (Qt::Orientation)
void setScaleDraw (QwtScaleDraw *)
void setScalePosition (ScalePos s)
void setThumbLength (int l)
void setThumbWidth (int w)
virtual QSize sizeHint () const
int thumbLength () const
int thumbWidth () const
Protected Member Functions¶
void draw (QPainter *p, const QRect &update_rect)
virtual void drawSlider (QPainter *p, const QRect &r)
virtual void drawThumb (QPainter *p, const QRect &, int pos)
virtual void fontChange (const QFont &oldFont)
virtual void getScrollMode (const QPoint &p, int &scrollMode,
int &direction)
virtual double getValue (const QPoint &p)
void layoutSlider (bool update=true)
virtual void paintEvent (QPaintEvent *e)
virtual void rangeChange ()
virtual void resizeEvent (QResizeEvent *e)
virtual void scaleChange ()
QwtScaleDraw * scaleDraw ()
virtual void valueChange ()
int xyPosition (double v) const
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:
Member Enumeration Documentation¶
enum QwtSlider::BGSTYLE¶
Background style.
See also:
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:
Constructor & Destructor Documentation¶
QwtSlider::QwtSlider (QWidget *parent, Qt::Orientationorientation = Qt::Horizontal, ScalePosscalePos = NoScale, BGSTYLEbgStyle = BgTrough) [explicit]¶
Constructor. Parameters:
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::BgTrough draws the slider button in a trough, QwtSlider::BgSlot draws a slot underneath the button. An or-combination of both may also be used. The default is QwtSlider::BgTrough.
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::BGSTYLE QwtSlider::bgStyle () const¶
Returns:
int QwtSlider::borderWidth () const¶
Returns:
void QwtSlider::drawSlider (QPainter *painter, const QRect &r) [protected], [virtual]¶
Draw the slider into the specified rectangle.
Parameters:
r Rectangle
void QwtSlider::drawThumb (QPainter *painter, const QRect &sliderRect, intpos) [protected], [virtual]¶
Draw the thumb at a position
Parameters:
sliderRect Bounding rectangle of the slider
pos Position of the slider thumb
void QwtSlider::getScrollMode (const QPoint &p, int &scrollMode, int &direction) [protected], [virtual]¶
Determine scrolling mode and direction. Parameters:
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:
Implements QwtAbstractSlider.
void QwtSlider::layoutSlider (boolupdate_geometry = true) [protected]¶
Recalculate the slider's geometry and layout based on the current rect and fonts.
Parameters:
QSize QwtSlider::minimumSizeHint () const [virtual]¶
Return a minimum size hint. Warning:
void QwtSlider::paintEvent (QPaintEvent *event) [protected], [virtual]¶
Qt paint event
Parameters:
const QwtScaleDraw * QwtSlider::scaleDraw () const¶
Returns:
See also:
QwtScaleDraw * QwtSlider::scaleDraw () [protected]¶
Returns:
See also:
void QwtSlider::setBgStyle (BGSTYLEst)¶
Set the background style.
void QwtSlider::setBorderWidth (intbd)¶
Change the slider's border width. Parameters:
void QwtSlider::setMargins (intxMargin, intyMargin)¶
Set distances between the widget's border and internals. Parameters:
yMargin Vertical margin
void QwtSlider::setOrientation (Qt::Orientationo) [virtual]¶
Set the orientation. Parameters:
If the new orientation and the old scale position are an invalid combination, the scale position will be set to QwtSlider::NoScale.
See also:
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:
void QwtSlider::setScalePosition (ScalePoss)¶
Change the scale position (and slider orientation). Parameters:
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::setThumbLength (intthumbLength)¶
Set the slider's thumb length. Parameters:
void QwtSlider::setThumbWidth (intw)¶
Change the width of the thumb. Parameters:
QSize QwtSlider::sizeHint () const [virtual]¶
Returns:
int QwtSlider::thumbLength () const¶
Returns:
int QwtSlider::thumbWidth () const¶
Returns:
int QwtSlider::xyPosition (doublevalue) const [protected]¶
Find the x/y position for a given value v
Parameters:
Author¶
Generated automatically by Doxygen for Qwt User's Guide from the source code.
Tue Nov 20 2012 | Version 5.2.3 |