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

轮式控件 更多...

#include <qwt_wheel.h>

类 QwtWheel 继承关系图:

class  PrivateData
 

Public 槽

void setValue (double)
 设置新值而不调整到步栅格
 
void setTotalAngle (double)
 
void setViewAngle (double)
 指定轮的可见部分
 
void setMass (double)
 设置滑块的质量以实现飞轮效果
 

信号

void valueChanged (double value)
 通知值变化
 
void wheelPressed ()
 当用户用鼠标按下轮时发出此信号
 
void wheelReleased ()
 当用户释放鼠标时发出此信号
 
void wheelMoved (double value)
 当用户用鼠标移动轮时发出此信号
 

Public 成员函数

 QwtWheel (QWidget *parent=nullptr)
 Constructor
 
virtual ~QwtWheel ()
 Destructor
 
double value () const
 Return the current value
 
void setOrientation (Qt::Orientation)
 Set the wheel orientation
 
Qt::Orientation orientation () const
 Return the orientation
 
double totalAngle () const
 Return the total angle
 
double viewAngle () const
 Return the view angle
 
void setTickCount (int)
 Set the number of ticks
 
int tickCount () const
 Return the number of ticks
 
void setWheelWidth (int)
 Set the wheel width
 
int wheelWidth () const
 Return the wheel width
 
void setWheelBorderWidth (int)
 Set the wheel border width
 
int wheelBorderWidth () const
 Return the wheel border width
 
void setBorderWidth (int)
 Set the outer border width
 
int borderWidth () const
 Return the outer border width
 
void setInverted (bool)
 Set inverted appearance
 
bool isInverted () const
 Return whether the wheel is inverted
 
void setWrapping (bool)
 Set wrapping mode
 
bool wrapping () const
 Return whether wrapping is enabled
 
void setSingleStep (double)
 Set single step size
 
double singleStep () const
 Return single step size
 
void setPageStepCount (int)
 Set page step count
 
int pageStepCount () const
 Return page step count
 
void setStepAlignment (bool on)
 Set step alignment
 
bool stepAlignment () const
 Return whether step alignment is enabled
 
void setRange (double min, double max)
 Set value range
 
void setMinimum (double)
 Set minimum value
 
double minimum () const
 Return minimum value
 
void setMaximum (double)
 Set maximum value
 
double maximum () const
 Return maximum value
 
void setUpdateInterval (int)
 Set update interval
 
int updateInterval () const
 Return update interval
 
void setTracking (bool)
 Set tracking mode
 
bool isTracking () const
 Return whether tracking is enabled
 
double mass () const
 Return mass for flywheel effect
 

Protected 成员函数

virtual void paintEvent (QPaintEvent *) override
 
virtual void mousePressEvent (QMouseEvent *) override
 
virtual void mouseReleaseEvent (QMouseEvent *) override
 
virtual void mouseMoveEvent (QMouseEvent *) override
 
virtual void keyPressEvent (QKeyEvent *) override
 处理键盘事件
 
virtual void wheelEvent (QWheelEvent *) override
 
virtual void timerEvent (QTimerEvent *) override
 
void stopFlying ()
 
QRect wheelRect () const
 
virtual QSize sizeHint () const override
 返回大小提示
 
virtual QSize minimumSizeHint () const override
 返回最小大小提示
 
virtual void drawTicks (QPainter *, const QRectF &)
 Draw the Wheel's ticks
 
virtual void drawWheelBackground (QPainter *, const QRectF &)
 Draw the Wheel's background gradient
 
virtual double valueAt (const QPoint &) const
 Determine the value corresponding to a specified point
 

属性

Qt::Orientation orientation
 
double value
 
double minimum
 
double maximum
 
double singleStep
 
int pageStepCount
 
bool stepAlignment
 
bool tracking
 
bool wrapping
 
bool inverted
 
double mass
 
int updateInterval
 
double totalAngle
 
double viewAngle
 
int tickCount
 
int wheelWidth
 
int borderWidth
 
int wheelBorderWidth
 

详细描述

轮式控件

成员函数说明

◆ borderWidth()

int QwtWheel::borderWidth ( ) const

Return the outer border width

返回
边框宽度
参见
setBorderWidth()

◆ drawTicks()

void QwtWheel::drawTicks ( QPainter *  painter,
const QRectF &  rect 
)
protectedvirtual

Draw the Wheel's ticks

参数
painterPainter
rectGeometry for the wheel

◆ drawWheelBackground()

void QwtWheel::drawWheelBackground ( QPainter *  painter,
const QRectF &  rect 
)
protectedvirtual

Draw the Wheel's background gradient

参数
painterPainter
rectGeometry for the wheel

◆ isInverted()

bool QwtWheel::isInverted ( ) const

Return whether the wheel is inverted

返回轮是否反转

◆ isTracking()

bool QwtWheel::isTracking ( ) const

Return whether tracking is enabled

返回
当启用跟踪时返回 true
参见
setTracking(), valueChanged(), wheelMoved()

◆ keyPressEvent()

void QwtWheel::keyPressEvent ( QKeyEvent *  event)
overrideprotectedvirtual

处理键盘事件

  • Qt::Key_Home
    步进到 minimum()
  • Qt::Key_End
    步进到 maximum()
  • Qt::Key_Up
    对于水平或非反向的垂直轮,值将增加步长。 对于反向的垂直轮,值将减少步长。
  • Qt::Key_Down
    对于水平或非反向的垂直轮,值将减少步长。 对于反向的垂直轮,值将增加步长。
  • Qt::Key_PageUp
    值将增加 pageStepSize() * singleStepSize()。
  • Qt::Key_PageDown
    值将减少 pageStepSize() * singleStepSize()。
参数
event键盘事件

◆ mass()

double QwtWheel::mass ( ) const

Return mass for flywheel effect

返回飞轮效果的质量

◆ maximum()

double QwtWheel::maximum ( ) const

Return maximum value

返回范围的最大值

◆ minimum()

double QwtWheel::minimum ( ) const

Return minimum value

返回范围的最小值

◆ minimumSizeHint()

QSize QwtWheel::minimumSizeHint ( ) const
overrideprotectedvirtual

返回最小大小提示

◆ mouseMoveEvent()

void QwtWheel::mouseMoveEvent ( QMouseEvent *  event)
overrideprotectedvirtual

鼠标移动事件处理程序

根据鼠标位置转动轮

参数
event鼠标事件

◆ mousePressEvent()

void QwtWheel::mousePressEvent ( QMouseEvent *  event)
overrideprotectedvirtual

鼠标按下事件处理程序

开始轮的移动。

参数
event鼠标事件

◆ mouseReleaseEvent()

void QwtWheel::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotectedvirtual

鼠标释放事件处理程序

当轮没有质量时,轮的移动停止,否则开始飞行。

参数
event鼠标事件

◆ orientation()

Qt::Orientation QwtWheel::orientation ( ) const

Return the orientation

返回方向

◆ pageStepCount()

int QwtWheel::pageStepCount ( ) const

Return page step count

返回页步数

◆ paintEvent()

void QwtWheel::paintEvent ( QPaintEvent *  event)
overrideprotectedvirtual

Qt 绘制事件

参数
event绘制事件

◆ setBorderWidth()

void QwtWheel::setBorderWidth ( int  width)

Set the outer border width

设置边框宽度

边框默认为 2。

参数
width边框宽度
参见
borderWidth()

◆ setInverted()

void QwtWheel::setInverted ( bool  on)

Set inverted appearance

启用/禁用反转外观

◆ setMass

void QwtWheel::setMass ( double  mass)
slot

设置滑块的质量以实现飞轮效果

◆ setMaximum()

void QwtWheel::setMaximum ( double  value)

Set maximum value

设置范围的最大值

◆ setMinimum()

void QwtWheel::setMinimum ( double  value)

Set minimum value

设置范围的最小值

◆ setOrientation()

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

Set the wheel orientation

设置轮的方向

◆ setPageStepCount()

void QwtWheel::setPageStepCount ( int  count)

Set page step count

设置页步数

◆ setRange()

void QwtWheel::setRange ( double  min,
double  max 
)

Set value range

设置最小值和最大值

◆ setSingleStep()

void QwtWheel::setSingleStep ( double  stepSize)

Set single step size

设置计数器的步长

◆ setStepAlignment()

void QwtWheel::setStepAlignment ( bool  on)

Set step alignment

启用/禁用步对齐

◆ setTickCount()

void QwtWheel::setTickCount ( int  count)

Set the number of ticks

调整轮表面凹槽的数量。

凹槽数量限制为 6 <= count <= 50。 超出此范围的值将被裁剪。 默认值为 10。

参数
count每 360 度的凹槽数
参见
tickCount()

◆ setTotalAngle

void QwtWheel::setTotalAngle ( double  angle)
slot

设置轮可以转动的总角度。

轮的一整圈对应 360 度。 n*360 度的总角度意味着轮必须绕其轴转动 n 圈 才能从最小值到最大值。

总角度的默认设置是 360 度。

参数
angle总角度(度)
参见
totalAngle()

◆ setTracking()

void QwtWheel::setTracking ( bool  enable)

Set tracking mode

启用/禁用跟踪

如果启用了跟踪(默认),轮在移动时会发出 valueChanged() 信号。 如果禁用了跟踪,轮只在移动终止时才发出 valueChanged() 信号。

wheelMoved() 信号无论是否启用跟踪都会发出。

参数
enable开/关
参见
isTracking()

◆ setUpdateInterval()

void QwtWheel::setUpdateInterval ( int  interval)

Set update interval

指定轮飞行时的更新间隔

默认值和最小值是 50 毫秒。

参数
interval间隔(毫秒)
参见
updateInterval(), setMass(), setTracking()

◆ setValue

void QwtWheel::setValue ( double  value)
slot

设置新值而不调整到步栅格

◆ setViewAngle

void QwtWheel::setViewAngle ( double  angle)
slot

指定轮的可见部分

◆ setWheelBorderWidth()

void QwtWheel::setWheelBorderWidth ( int  borderWidth)

Set the wheel border width

设置轮的边框宽度。

轮边框不能小于 1, 并且根据轮的大小有限制。 超出允许范围的值将被裁剪。

轮边框默认为 2。

参数
borderWidth边框宽度
参见
internalBorder()

◆ setWheelWidth()

void QwtWheel::setWheelWidth ( int  width)

Set the wheel width

设置轮的宽度

◆ setWrapping()

void QwtWheel::setWrapping ( bool  on)

Set wrapping mode

启用/禁用环绕

◆ singleStep()

double QwtWheel::singleStep ( ) const

Return single step size

返回单步大小

◆ sizeHint()

QSize QwtWheel::sizeHint ( ) const
overrideprotectedvirtual

返回大小提示

◆ stepAlignment()

bool QwtWheel::stepAlignment ( ) const

Return whether step alignment is enabled

返回是否启用了步对齐

◆ stopFlying()

void QwtWheel::stopFlying ( )
protected

停止轮的飞行移动

◆ tickCount()

int QwtWheel::tickCount ( ) const

Return the number of ticks

返回
轮表面凹槽的数量。
参见
setTickCnt()

◆ timerEvent()

void QwtWheel::timerEvent ( QTimerEvent *  event)
overrideprotectedvirtual

Qt 定时器事件

飞轮效果使用定时器实现

参数
event定时器事件
参见
updateInterval()

◆ totalAngle()

double QwtWheel::totalAngle ( ) const

Return the total angle

返回
轮可以转动的总角度。
参见
setTotalAngle()

◆ updateInterval()

int QwtWheel::updateInterval ( ) const

Return update interval

返回
轮飞行时的更新间隔
参见
setUpdateInterval(), mass(), isTracking()

◆ value()

double QwtWheel::value ( ) const

Return the current value

返回轮的当前值

◆ valueAt()

double QwtWheel::valueAt ( const QPoint &  pos) const
protectedvirtual

Determine the value corresponding to a specified point

参数
posPosition
返回
Value corresponding to pos

◆ valueChanged

void QwtWheel::valueChanged ( double  value)
signal

通知值变化

◆ viewAngle()

double QwtWheel::viewAngle ( ) const

Return the view angle

返回轮的可见部分

◆ wheelBorderWidth()

int QwtWheel::wheelBorderWidth ( ) const

Return the wheel border width

返回
轮边框宽度
参见
setWheelBorderWidth()

◆ wheelEvent()

void QwtWheel::wheelEvent ( QWheelEvent *  event)
overrideprotectedvirtual

处理轮事件

增加/减少值

参数
event轮事件

◆ wheelMoved

void QwtWheel::wheelMoved ( double  value)
signal

当用户用鼠标移动轮时发出此信号

◆ wheelPressed

void QwtWheel::wheelPressed ( )
signal

当用户用鼠标按下轮时发出此信号

◆ wheelRect()

QRect QwtWheel::wheelRect ( ) const
protected
返回
Rectangle of the wheel without the outer border

◆ wheelReleased

void QwtWheel::wheelReleased ( )
signal

当用户释放鼠标时发出此信号

◆ wheelWidth()

int QwtWheel::wheelWidth ( ) const

Return the wheel width

返回轮的宽度

◆ wrapping()

bool QwtWheel::wrapping ( ) const

Return whether wrapping is enabled

返回是否启用了环绕


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