QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
载入中...
搜索中...
未找到
| Public 类型 | Public 成员函数 | Protected 成员函数 | 属性 | 所有成员列表
QwtSlider类 参考

滑块控件 更多...

#include <qwt_slider.h>

类 QwtSlider 继承关系图:
QwtAbstractSlider QwtAbstractScale

class  PrivateData
 

Public 类型

enum  ScalePosition { NoScale , LeadingScale , TrailingScale }
 刻度位置 更多...
 

Public 成员函数

 QwtSlider (QWidget *parent=nullptr)
 Constructor
 
 QwtSlider (Qt::Orientation, QWidget *parent=nullptr)
 Constructor with orientation
 
virtual ~QwtSlider ()
 Destructor
 
void setOrientation (Qt::Orientation)
 Set orientation
 
Qt::Orientation orientation () const
 Return orientation
 
void setScalePosition (ScalePosition)
 Set scale position
 
ScalePosition scalePosition () const
 Return scale position
 
void setTrough (bool)
 Enable/disable trough
 
bool hasTrough () const
 Check if has trough
 
void setGroove (bool)
 Enable/disable groove
 
bool hasGroove () const
 Check if has groove
 
void setHandleSize (const QSize &)
 Set handle size
 
QSize handleSize () const
 Return handle size
 
void setBorderWidth (int)
 Set border width
 
int borderWidth () const
 Return border width
 
void setSpacing (int)
 Set spacing
 
int spacing () const
 Return spacing
 
virtual QSize sizeHint () const override
 Return size hint
 
virtual QSize minimumSizeHint () const override
 Return minimum size hint
 
void setScaleDraw (QwtScaleDraw *)
 Set scale draw
 
const QwtScaleDrawscaleDraw () const
 Return scale draw (const version)
 
void setUpdateInterval (int)
 Set update interval
 
int updateInterval () const
 Return update interval
 
- Public 成员函数 继承自 QwtAbstractSlider
 QwtAbstractSlider (QWidget *parent=nullptr)
 Constructor for QwtAbstractSlider (English only)
 
virtual ~QwtAbstractSlider ()
 Destructor for QwtAbstractSlider (English only)
 
void setValid (bool)
 Set whether the slider is valid (English only)
 
bool isValid () const
 Return whether the slider is valid (English only)
 
double value () const
 Return the current value (English only)
 
void setWrapping (bool)
 Set whether wrapping is enabled (English only)
 
bool wrapping () const
 Return whether wrapping is enabled (English only)
 
void setTotalSteps (uint)
 Set the total number of steps (English only)
 
uint totalSteps () const
 Return the total number of steps (English only)
 
void setSingleSteps (uint)
 Set the number of single steps (English only)
 
uint singleSteps () const
 Return the number of single steps (English only)
 
void setPageSteps (uint)
 Set the number of page steps (English only)
 
uint pageSteps () const
 Return the number of page steps (English only)
 
void setStepAlignment (bool)
 Set whether step alignment is enabled (English only)
 
bool stepAlignment () const
 Return whether step alignment is enabled (English only)
 
void setTracking (bool)
 Set whether tracking is enabled (English only)
 
bool isTracking () const
 Return whether tracking is enabled (English only)
 
void setReadOnly (bool)
 Set whether the slider is read-only (English only)
 
bool isReadOnly () const
 Return whether the slider is read-only (English only)
 
void setInvertedControls (bool)
 Set whether controls are inverted (English only)
 
bool invertedControls () const
 Return whether controls are inverted (English only)
 
- Public 成员函数 继承自 QwtAbstractScale
 QwtAbstractScale (QWidget *parent=nullptr)
 QwtAbstractScale 构造函数
 
virtual ~QwtAbstractScale ()
 QwtAbstractScale 析构函数
 
void setScale (double lowerBound, double upperBound)
 通过区间边界指定刻度
 
void setScale (const QwtInterval &)
 通过区间对象指定刻度
 
void setScale (const QwtScaleDiv &)
 通过刻度划分指定刻度
 
const QwtScaleDivscaleDiv () const
 返回刻度划分
 
void setLowerBound (double value)
 设置刻度的下界
 
double lowerBound () const
 返回刻度的下界
 
void setUpperBound (double value)
 设置刻度的上界
 
double upperBound () const
 返回刻度的上界
 
void setScaleStepSize (double stepSize)
 设置用于计算刻度划分的步长
 
double scaleStepSize () const
 返回步长提示值
 
void setScaleMaxMajor (int ticks)
 设置主刻度间隔的最大数量
 
int scaleMaxMinor () const
 返回次刻度间隔的最大数量
 
void setScaleMaxMinor (int ticks)
 设置次刻度间隔的最大数量
 
int scaleMaxMajor () const
 返回主刻度间隔的最大数量
 
void setScaleEngine (QwtScaleEngine *)
 设置刻度引擎
 
const QwtScaleEnginescaleEngine () const
 返回刻度引擎(常量版本)
 
QwtScaleEnginescaleEngine ()
 返回刻度引擎(非常量版本)
 
int transform (double) const
 将刻度值转换为控件坐标
 
double invTransform (int) const
 将控件坐标转换为刻度值
 
bool isInverted () const
 检查刻度是否反向
 
double minimum () const
 返回最小边界
 
double maximum () const
 返回最大边界
 
const QwtScaleMapscaleMap () const
 返回刻度映射
 

Protected 成员函数

virtual double scrolledTo (const QPoint &) const override
 Calculate scrolled position
 
virtual bool isScrollPosition (const QPoint &) const override
 Check if position is scroll position
 
virtual void drawSlider (QPainter *, const QRect &) const
 Draw slider
 
virtual void drawHandle (QPainter *, const QRect &, int pos) const
 Draw handle
 
virtual void mousePressEvent (QMouseEvent *) override
 Mouse press event
 
virtual void mouseReleaseEvent (QMouseEvent *) override
 Mouse release event
 
virtual void resizeEvent (QResizeEvent *) override
 Resize event
 
virtual void paintEvent (QPaintEvent *) override
 Paint event
 
virtual void changeEvent (QEvent *) override
 Change event
 
virtual void timerEvent (QTimerEvent *) override
 Timer event
 
virtual bool event (QEvent *) override
 Event handler
 
virtual void scaleChange () override
 Scale change notification
 
QRect sliderRect () const
 Return slider rectangle
 
QRect handleRect () const
 Return handle rectangle
 
- Protected 成员函数 继承自 QwtAbstractSlider
virtual void mouseMoveEvent (QMouseEvent *) override
 Handle mouse move events (English only)
 
virtual void keyPressEvent (QKeyEvent *) override
 Handle key press events (English only)
 
virtual void wheelEvent (QWheelEvent *) override
 Handle wheel events (English only)
 
void incrementValue (int stepCount)
 Increment the value by a number of steps (English only)
 
virtual void sliderChange ()
 Handle slider changes (English only)
 
double incrementedValue (double value, int stepCount) const
 Calculate incremented value (English only)
 
- Protected 成员函数 继承自 QwtAbstractScale
void rescale (double lowerBound, double upperBound, double stepSize)
 Recalculate scale and update scale draw (English only)
 
void setAbstractScaleDraw (QwtAbstractScaleDraw *)
 Set the scale draw object (English only)
 
const QwtAbstractScaleDrawabstractScaleDraw () const
 Return the scale draw (const version) (English only)
 
QwtAbstractScaleDrawabstractScaleDraw ()
 Return the scale draw (non-const version) (English only)
 
void updateScaleDraw ()
 Update the scale draw (English only)
 

属性

Qt::Orientation orientation
 
ScalePosition scalePosition
 
bool trough
 
bool groove
 
QSize handleSize
 
int borderWidth
 
int spacing
 
- 属性 继承自 QwtAbstractSlider
double value
 
uint totalSteps
 
uint singleSteps
 
uint pageSteps
 
bool stepAlignment
 
bool readOnly
 
bool tracking
 
bool wrapping
 
bool invertedControls
 
- 属性 继承自 QwtAbstractScale
double lowerBound
 
double upperBound
 
int scaleMaxMajor
 
int scaleMaxMinor
 
double scaleStepSize
 

额外继承的成员函数

- Public 槽 继承自 QwtAbstractSlider
void setValue (double value)
 Set the slider value (English only)
 
- 信号 继承自 QwtAbstractSlider
void valueChanged (double value)
 通知值变化
 
void sliderPressed ()
 当用户按下滑块的可移动部分时发出的信号
 
void sliderReleased ()
 当用户释放滑块的可移动部分时发出的信号
 
void sliderMoved (double value)
 当用户用鼠标移动滑块时发出的信号
 

详细描述

滑块控件

成员枚举类型说明

◆ ScalePosition

刻度位置

枚举值
NoScale 

The slider has no scale

LeadingScale 

The scale is right of a vertical or below a horizontal slider

TrailingScale 

The scale is left of a vertical or above a horizontal slider

构造及析构函数说明

◆ QwtSlider() [1/2]

QwtSlider::QwtSlider ( QWidget *  parent = nullptr)
explicit

Constructor

构造垂直滑块 (QwtSlider::Trough 样式)

◆ QwtSlider() [2/2]

QwtSlider::QwtSlider ( Qt::Orientation  orientation,
QWidget *  parent = nullptr 
)
explicit

Constructor with orientation

构造滑块 (QwtSlider::Trough 样式)

◆ ~QwtSlider()

QwtSlider::~QwtSlider ( )
virtual

Destructor

析构函数

成员函数说明

◆ borderWidth()

int QwtSlider::borderWidth ( ) const

Return border width

返回边框宽度

◆ changeEvent()

void QwtSlider::changeEvent ( QEvent *  event)
overrideprotectedvirtual

Change event

重载 QwtAbstractScale .

◆ handleSize()

QSize QwtSlider::handleSize ( ) const

Return handle size

返回手柄大小

◆ hasGroove()

bool QwtSlider::hasGroove ( ) const

Check if has groove

当凹槽可见时返回 true

◆ hasTrough()

bool QwtSlider::hasTrough ( ) const

Check if has trough

当槽可见时返回 true

◆ isScrollPosition()

bool QwtSlider::isScrollPosition ( const QPoint &  pos) const
overrideprotectedvirtual

Check if position is scroll position

实现了 QwtAbstractSlider.

◆ minimumSizeHint()

QSize QwtSlider::minimumSizeHint ( ) const
overridevirtual

Return minimum size hint

返回最小大小提示

◆ mousePressEvent()

void QwtSlider::mousePressEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Mouse press event

重载 QwtAbstractSlider .

◆ mouseReleaseEvent()

void QwtSlider::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotectedvirtual

Mouse release event

重载 QwtAbstractSlider .

◆ orientation()

Qt::Orientation QwtSlider::orientation ( ) const

Return orientation

返回方向

◆ scaleChange()

void QwtSlider::scaleChange ( )
overrideprotectedvirtual

Scale change notification

重载 QwtAbstractSlider .

◆ scaleDraw()

const QwtScaleDraw * QwtSlider::scaleDraw ( ) const

Return scale draw (const version)

返回滑块的刻度绘制器 (const 版本)

◆ scalePosition()

QwtSlider::ScalePosition QwtSlider::scalePosition ( ) const

Return scale position

返回刻度位置

◆ scrolledTo()

double QwtSlider::scrolledTo ( const QPoint &  pos) const
overrideprotectedvirtual

Calculate scrolled position

实现了 QwtAbstractSlider.

◆ setBorderWidth()

void QwtSlider::setBorderWidth ( int  width)

Set border width

更改滑块的边框宽度

◆ setGroove()

void QwtSlider::setGroove ( bool  on)

Enable/disable groove

启用/禁用凹槽

◆ setHandleSize()

void QwtSlider::setHandleSize ( const QSize &  size)

Set handle size

设置滑块手柄大小

◆ setOrientation()

void QwtSlider::setOrientation ( Qt::Orientation  orientation)

Set orientation

设置方向

◆ setScaleDraw()

void QwtSlider::setScaleDraw ( QwtScaleDraw scaleDraw)

Set scale draw

设置刻度绘制器

◆ setScalePosition()

void QwtSlider::setScalePosition ( ScalePosition  scalePosition)

Set scale position

更改刻度位置

◆ setSpacing()

void QwtSlider::setSpacing ( int  spacing)

Set spacing

更改槽和刻度之间的间距

◆ setTrough()

void QwtSlider::setTrough ( bool  on)

Enable/disable trough

启用/禁用槽

◆ setUpdateInterval()

void QwtSlider::setUpdateInterval ( int  interval)

Set update interval

指定自动刷新的更新间隔

◆ sizeHint()

QSize QwtSlider::sizeHint ( ) const
overridevirtual

Return size hint

返回大小提示

◆ spacing()

int QwtSlider::spacing ( ) const

Return spacing

返回滑块和刻度之间的像素数

◆ updateInterval()

int QwtSlider::updateInterval ( ) const

Return update interval

返回自动刷新的更新间隔 (毫秒)


该类的文档由以下文件生成: