|
QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
|
包含刻度的控件 更多...
#include <qwt_scale_widget.h>
类 | |
| class | PrivateData |
Public 类型 | |
| enum | LayoutFlag { TitleInverted = 1 } |
| Layout flags of the title 更多... | |
| enum | BuiltinActions { ActionNone = 0x00 , ActionWheelZoom = 0x01 , ActionClickPan = 0x02 , ActionAll = 0xFF } |
| 内置的动作 更多... | |
信号 | |
| void | scaleDivChanged () |
| 当刻度分度发生变化时发出的信号 | |
| void | requestScaleRangeUpdate (double min, double max) |
| 坐标轴主动请求变更刻度范围 | |
| void | selectionChanged (bool selected) |
| 当前轴被选中状态发生变化发射信号 | |
Public 成员函数 | |
| QwtScaleWidget (QWidget *parent=nullptr) | |
| Constructor | |
| QwtScaleWidget (QwtScaleDraw::Alignment, QWidget *parent=nullptr) | |
| Constructor with alignment | |
| virtual | ~QwtScaleWidget () |
| Destructor | |
| void | setTitle (const QString &title) |
| Set the title | |
| void | setTitle (const QwtText &title) |
| Set the title | |
| QwtText | title () const |
| 获取标题 | |
| void | setLayoutFlag (LayoutFlag, bool on) |
| Set a layout flag | |
| bool | testLayoutFlag (LayoutFlag) const |
| 测试布局标志 | |
| void | setBorderDist (int dist1, int dist2) |
| Set the border distances | |
| int | startBorderDist () const |
| 获取起始边框距离 | |
| int | endBorderDist () const |
| 获取末端边框距离 | |
| void | getBorderDistHint (int &start, int &end) const |
| Get the border distance hint | |
| void | getMinBorderDist (int &start, int &end) const |
| Get the minimum border distances | |
| void | setMinBorderDist (int start, int end) |
| Set the minimum border distances | |
| int | startMinBorderDist () const |
| 获取刻度两端与控件边框的最小距离(左侧或顶部) | |
| int | endMinBorderDist () const |
| 获取刻度两端与控件边框的最小距离(右侧或底部) | |
| void | setMargin (int) |
| Set the margin | |
| int | margin () const |
| 获取边距 | |
| void | setSpacing (int) |
| Set the spacing | |
| int | spacing () const |
| 获取刻度和标题之间的距离 | |
| void | setEdgeMargin (int offset) |
| Set the edge margin (offset between axis and plot canvas) | |
| int | edgeMargin () const |
| 获取边缘距离 | |
| void | setScaleDiv (const QwtScaleDiv &) |
| Set the scale division | |
| void | setTransformation (QwtTransform *) |
| Set the transformation | |
| void | setScaleDraw (QwtScaleDraw *) |
| Set the scale draw | |
| const QwtScaleDraw * | scaleDraw () const |
| 获取刻度绘制对象(常量版本) | |
| QwtScaleDraw * | scaleDraw () |
| 获取刻度绘制对象 | |
| void | setLabelAlignment (Qt::Alignment) |
| Set the label alignment | |
| void | setLabelRotation (double rotation) |
| Set the label rotation | |
| void | setColorBarEnabled (bool) |
| Enable/disable the color bar | |
| bool | isColorBarEnabled () const |
| 检查颜色条是否已启用 | |
| void | setColorBarWidth (int) |
| Set the color bar width | |
| int | colorBarWidth () const |
| 获取颜色条的宽度 | |
| void | setColorMap (const QwtInterval &, QwtColorMap *) |
| Set the color map | |
| QwtInterval | colorBarInterval () const |
| 获取颜色条的值区间 | |
| const QwtColorMap * | colorMap () const |
| 获取颜色映射 | |
| virtual QSize | sizeHint () const override |
| 获取大小提示 | |
| virtual QSize | minimumSizeHint () const override |
| 获取最小大小提示 | |
| int | titleHeightForWidth (int width) const |
| 查找给定宽度下标题的高度 | |
| int | dimForLength (int length, const QFont &scaleFont) const |
| 查找给定长度的最小尺寸 | |
| void | drawColorBar (QPainter *, const QRectF &) const |
| Draw the color bar | |
| void | drawTitle (QPainter *, QwtScaleDraw::Alignment, const QRectF &rect) const |
| Draw the title | |
| void | setAlignment (QwtScaleDraw::Alignment) |
| Set the alignment | |
| QwtScaleDraw::Alignment | alignment () const |
| 获取对齐方式 | |
| QRectF | colorBarRect (const QRectF &) const |
| 计算颜色条的矩形区域 | |
| QRect | scaleRect () const |
| 获取用于绘制刻度的矩形区域(不包含 colorBar、margin、edgeMargin、borderDistHint) | |
| void | setTextColor (const QColor &c) |
| Set the text color (font color of the coordinate axis) | |
| QColor | textColor () const |
| 获取坐标轴的字体颜色 | |
| void | setScaleColor (const QColor &c) |
| Set the scale color (color of the coordinate axis) | |
| QColor | scaleColor () const |
| 获取坐标轴的颜色 | |
| void | layoutScale (bool update_geometry=true) |
| Layout the scale | |
| QwtAxisId | axisID () const |
| 获取此轴窗口对应的 axisID | |
| bool | isXAxis () const |
| 是否是 X 坐标轴 | |
| bool | isYAxis () const |
| 是否是 Y 坐标轴 | |
| void | setBuildinActions (BuiltinActionsFlags acts) |
| Enable/disable built-in actions | |
| BuiltinActionsFlags | buildinActions () const |
| 获取内置的动作标志 | |
| bool | testBuildinActions (BuiltinActions ba) const |
| 检测内置动作是否激活 | |
| void | setSelected (bool selected) |
| Set the selected state | |
| bool | isSelected () const |
| 当前轴是否被选中 | |
| void | setSelectionColor (const QColor &color) |
| Set the selection color | |
| QColor | selectionColor () const |
| 获取选中的颜色 | |
| void | setZoomFactor (double factor) |
| Set the zoom factor (default 1.2) | |
| double | zoomFactor () const |
| 获取缩放因子 | |
| void | setSelectedPenWidthOffset (qreal offset=1) |
| Set the selected pen width offset | |
| qreal | selectedPenWidthOffset () const |
| 获取当前坐标轴在选中状态下的画笔宽度附加值 | |
| bool | isOnScale (const QPoint &pos) const |
| Check if a point is on the scale area | |
Protected 成员函数 | |
| virtual void | paintEvent (QPaintEvent *) override |
| paintEvent | |
| virtual void | resizeEvent (QResizeEvent *) override |
| Event handler for resize events | |
| virtual void | changeEvent (QEvent *) override |
| Change Event handler | |
| void | draw (QPainter *) const |
| draw the scale | |
| void | scaleChange () |
| Notify a change of the scale | |
包含刻度的控件
|
explicit |
Constructor
创建位置为 QwtScaleWidget::Left 的刻度
| QwtScaleDraw::Alignment QwtScaleWidget::alignment | ( | ) | const |
获取对齐方式
| QwtAxisId QwtScaleWidget::axisID | ( | ) | const |
获取此轴窗口对应的 axisID
| QwtScaleWidget::BuiltinActionsFlags QwtScaleWidget::buildinActions | ( | ) | const |
获取内置的动作标志
|
overrideprotectedvirtual |
Change Event handler
| event | Change event |
Invalidates internal caches if necessary
| QwtInterval QwtScaleWidget::colorBarInterval | ( | ) | const |
获取颜色条的值区间
| QRectF QwtScaleWidget::colorBarRect | ( | const QRectF & | rect | ) | const |
计算颜色条的矩形区域
| int QwtScaleWidget::colorBarWidth | ( | ) | const |
获取颜色条的宽度
| const QwtColorMap * QwtScaleWidget::colorMap | ( | ) | const |
获取颜色映射
| int QwtScaleWidget::dimForLength | ( | int | length, |
| const QFont & | scaleFont | ||
| ) | const |
查找给定长度的最小尺寸
| void QwtScaleWidget::drawColorBar | ( | QPainter * | painter, |
| const QRectF & | rect | ||
| ) | const |
Draw the color bar
绘制刻度控件的颜色条
| void QwtScaleWidget::drawTitle | ( | QPainter * | painter, |
| QwtScaleDraw::Alignment | align, | ||
| const QRectF & | rect | ||
| ) | const |
Draw the title
根据标题的位置旋转并绘制标题到指定矩形区域
| int QwtScaleWidget::edgeMargin | ( | ) | const |
获取边缘距离
| int QwtScaleWidget::endBorderDist | ( | ) | const |
获取末端边框距离
| int QwtScaleWidget::endMinBorderDist | ( | ) | const |
获取刻度两端与控件边框的最小距离(右侧或底部)
| void QwtScaleWidget::getBorderDistHint | ( | int & | start, |
| int & | end | ||
| ) | const |
Get the border distance hint
计算边框距离的"建议值"
| void QwtScaleWidget::getMinBorderDist | ( | int & | start, |
| int & | end | ||
| ) | const |
Get the minimum border distances
获取刻度两端与控件边框的最小距离
| bool QwtScaleWidget::isColorBarEnabled | ( | ) | const |
检查颜色条是否已启用
| bool QwtScaleWidget::isOnScale | ( | const QPoint & | pos | ) | const |
Check if a point is on the scale area
判断鼠标位置是否落在"纯刻度区域"
| bool QwtScaleWidget::isSelected | ( | ) | const |
当前轴是否被选中
| bool QwtScaleWidget::isXAxis | ( | ) | const |
是否是 X 坐标轴
| bool QwtScaleWidget::isYAxis | ( | ) | const |
是否是 Y 坐标轴
| void QwtScaleWidget::layoutScale | ( | bool | update_geometry = true | ) |
Layout the scale
根据当前几何形状和字体重新计算刻度的几何形状和布局
| int QwtScaleWidget::margin | ( | ) | const |
获取边距
|
overridevirtual |
获取最小大小提示
|
signal |
坐标轴主动请求变更刻度范围
|
overrideprotectedvirtual |
Event handler for resize events
| event | Resize event |
|
protected |
Notify a change of the scale
This virtual function can be overloaded by derived classes. The default implementation updates the geometry and repaints the widget.
| QColor QwtScaleWidget::scaleColor | ( | ) | const |
获取坐标轴的颜色
|
signal |
当刻度分度发生变化时发出的信号
| QwtScaleDraw * QwtScaleWidget::scaleDraw | ( | ) |
获取刻度绘制对象
| const QwtScaleDraw * QwtScaleWidget::scaleDraw | ( | ) | const |
获取刻度绘制对象(常量版本)
| QRect QwtScaleWidget::scaleRect | ( | ) | const |
获取用于绘制刻度的矩形区域(不包含 colorBar、margin、edgeMargin、borderDistHint)
| qreal QwtScaleWidget::selectedPenWidthOffset | ( | ) | const |
获取当前坐标轴在选中状态下的画笔宽度附加值
|
signal |
当前轴被选中状态发生变化发射信号
| QColor QwtScaleWidget::selectionColor | ( | ) | const |
获取选中的颜色
| void QwtScaleWidget::setAlignment | ( | QwtScaleDraw::Alignment | alignment | ) |
Set the alignment
更改对齐方式
| void QwtScaleWidget::setBorderDist | ( | int | dist1, |
| int | dist2 | ||
| ) |
Set the border distances
设置刻度两端与控件边框的距离
| void QwtScaleWidget::setBuildinActions | ( | BuiltinActionsFlags | acts | ) |
Enable/disable built-in actions
设置内置的动作
| void QwtScaleWidget::setColorBarEnabled | ( | bool | on | ) |
Enable/disable the color bar
启用/禁用与刻度关联的颜色条
| void QwtScaleWidget::setColorBarWidth | ( | int | width | ) |
Set the color bar width
设置颜色条的宽度
| void QwtScaleWidget::setColorMap | ( | const QwtInterval & | interval, |
| QwtColorMap * | colorMap | ||
| ) |
Set the color map
设置用于显示颜色条的颜色映射和值区间
| void QwtScaleWidget::setEdgeMargin | ( | int | offset | ) |
Set the edge margin (offset between axis and plot canvas)
设置坐标轴和绘图边缘的空白偏移距离
| void QwtScaleWidget::setLabelAlignment | ( | Qt::Alignment | alignment | ) |
Set the label alignment
更改标签的对齐方式
| void QwtScaleWidget::setLabelRotation | ( | double | rotation | ) |
Set the label rotation
更改标签的旋转角度
| void QwtScaleWidget::setLayoutFlag | ( | LayoutFlag | flag, |
| bool | on | ||
| ) |
Set a layout flag
切换布局标志
| void QwtScaleWidget::setMargin | ( | int | margin | ) |
Set the margin
设置到颜色条/基线的边距
| void QwtScaleWidget::setMinBorderDist | ( | int | start, |
| int | end | ||
| ) |
Set the minimum border distances
设置刻度两端与控件边框的最小距离
| void QwtScaleWidget::setScaleColor | ( | const QColor & | c | ) |
Set the scale color (color of the coordinate axis)
设置坐标轴的颜色
| void QwtScaleWidget::setScaleDiv | ( | const QwtScaleDiv & | scaleDiv | ) |
Set the scale division
设置刻度划分
| void QwtScaleWidget::setScaleDraw | ( | QwtScaleDraw * | scaleDraw | ) |
Set the scale draw
设置刻度绘制对象
| void QwtScaleWidget::setSelected | ( | bool | selected | ) |
Set the selected state
设置当前轴被选中
| void QwtScaleWidget::setSelectedPenWidthOffset | ( | qreal | offset = 1 | ) |
Set the selected pen width offset
设置坐标轴在选中状态下的画笔宽度附加值
| void QwtScaleWidget::setSelectionColor | ( | const QColor & | color | ) |
Set the selection color
设置选中的颜色
| void QwtScaleWidget::setSpacing | ( | int | spacing | ) |
Set the spacing
设置颜色条、刻度和标题之间的距离
| void QwtScaleWidget::setTextColor | ( | const QColor & | c | ) |
Set the text color (font color of the coordinate axis)
设置坐标轴的字体颜色
| void QwtScaleWidget::setTitle | ( | const QString & | title | ) |
Set the title
设置标题的文本内容
| void QwtScaleWidget::setTitle | ( | const QwtText & | title | ) |
Set the title
设置标题的文本内容
| void QwtScaleWidget::setTransformation | ( | QwtTransform * | transformation | ) |
Set the transformation
设置变换
| void QwtScaleWidget::setZoomFactor | ( | double | factor | ) |
Set the zoom factor (default 1.2)
设置缩放因子(默认 1.2)
|
overridevirtual |
获取大小提示
| int QwtScaleWidget::spacing | ( | ) | const |
获取刻度和标题之间的距离
| int QwtScaleWidget::startBorderDist | ( | ) | const |
获取起始边框距离
| int QwtScaleWidget::startMinBorderDist | ( | ) | const |
获取刻度两端与控件边框的最小距离(左侧或顶部)
| bool QwtScaleWidget::testBuildinActions | ( | QwtScaleWidget::BuiltinActions | ba | ) | const |
检测内置动作是否激活
| bool QwtScaleWidget::testLayoutFlag | ( | LayoutFlag | flag | ) | const |
测试布局标志
| QColor QwtScaleWidget::textColor | ( | ) | const |
获取坐标轴的字体颜色
| QwtText QwtScaleWidget::title | ( | ) | const |
获取标题
| int QwtScaleWidget::titleHeightForWidth | ( | int | width | ) | const |
查找给定宽度下标题的高度
| double QwtScaleWidget::zoomFactor | ( | ) | const |
获取缩放因子