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

包含刻度的控件 更多...

#include <qwt_scale_widget.h>

类 QwtScaleWidget 继承关系图:

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 QwtScaleDrawscaleDraw () const
 获取刻度绘制对象(常量版本)
 
QwtScaleDrawscaleDraw ()
 获取刻度绘制对象
 
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 QwtColorMapcolorMap () 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
 

详细描述

包含刻度的控件

成员枚举类型说明

◆ BuiltinActions

内置的动作

枚举值
ActionNone 

No action

ActionWheelZoom 

Mouse wheel zoom (after clicking to activate the axis, scrolling the wheel zooms the current axis)

ActionClickPan 

Mouse click and drag (after clicking to activate the axis, dragging moves the axis left/right)

ActionAll 

All actions

◆ LayoutFlag

Layout flags of the title

枚举值
TitleInverted 

The title of vertical scales is painted from top to bottom. Otherwise it is painted from bottom to top.

构造及析构函数说明

◆ QwtScaleWidget()

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

Constructor

创建位置为 QwtScaleWidget::Left 的刻度

成员函数说明

◆ alignment()

QwtScaleDraw::Alignment QwtScaleWidget::alignment ( ) const

获取对齐方式

返回
the alignment

◆ axisID()

QwtAxisId QwtScaleWidget::axisID ( ) const

获取此轴窗口对应的 axisID

返回
the axis ID for this scale widget

◆ buildinActions()

QwtScaleWidget::BuiltinActionsFlags QwtScaleWidget::buildinActions ( ) const

获取内置的动作标志

返回
the built-in actions flags

◆ changeEvent()

void QwtScaleWidget::changeEvent ( QEvent *  event)
overrideprotectedvirtual

Change Event handler

参数
eventChange event

Invalidates internal caches if necessary

◆ colorBarInterval()

QwtInterval QwtScaleWidget::colorBarInterval ( ) const

获取颜色条的值区间

返回
the color bar interval

◆ colorBarRect()

QRectF QwtScaleWidget::colorBarRect ( const QRectF &  rect) const

计算颜色条的矩形区域

返回
the rectangle for the color bar

◆ colorBarWidth()

int QwtScaleWidget::colorBarWidth ( ) const

获取颜色条的宽度

返回
the color bar width

◆ colorMap()

const QwtColorMap * QwtScaleWidget::colorMap ( ) const

获取颜色映射

返回
the color map

◆ dimForLength()

int QwtScaleWidget::dimForLength ( int  length,
const QFont &  scaleFont 
) const

查找给定长度的最小尺寸

返回
the dimension required for a given length

◆ drawColorBar()

void QwtScaleWidget::drawColorBar ( QPainter *  painter,
const QRectF &  rect 
) const

Draw the color bar

绘制刻度控件的颜色条

◆ drawTitle()

void QwtScaleWidget::drawTitle ( QPainter *  painter,
QwtScaleDraw::Alignment  align,
const QRectF &  rect 
) const

Draw the title

根据标题的位置旋转并绘制标题到指定矩形区域

◆ edgeMargin()

int QwtScaleWidget::edgeMargin ( ) const

获取边缘距离

返回
the edge margin

◆ endBorderDist()

int QwtScaleWidget::endBorderDist ( ) const

获取末端边框距离

返回
the end border distance

◆ endMinBorderDist()

int QwtScaleWidget::endMinBorderDist ( ) const

获取刻度两端与控件边框的最小距离(右侧或底部)

返回
the end minimum border distance

◆ getBorderDistHint()

void QwtScaleWidget::getBorderDistHint ( int &  start,
int &  end 
) const

Get the border distance hint

计算边框距离的"建议值"

◆ getMinBorderDist()

void QwtScaleWidget::getMinBorderDist ( int &  start,
int &  end 
) const

Get the minimum border distances

获取刻度两端与控件边框的最小距离

◆ isColorBarEnabled()

bool QwtScaleWidget::isColorBarEnabled ( ) const

检查颜色条是否已启用

返回
true if color bar is enabled

◆ isOnScale()

bool QwtScaleWidget::isOnScale ( const QPoint &  pos) const

Check if a point is on the scale area

判断鼠标位置是否落在"纯刻度区域"

◆ isSelected()

bool QwtScaleWidget::isSelected ( ) const

当前轴是否被选中

返回
true if selected

◆ isXAxis()

bool QwtScaleWidget::isXAxis ( ) const

是否是 X 坐标轴

返回
true if this is an X axis

◆ isYAxis()

bool QwtScaleWidget::isYAxis ( ) const

是否是 Y 坐标轴

返回
true if this is a Y axis

◆ layoutScale()

void QwtScaleWidget::layoutScale ( bool  update_geometry = true)

Layout the scale

根据当前几何形状和字体重新计算刻度的几何形状和布局

◆ margin()

int QwtScaleWidget::margin ( ) const

获取边距

返回
the margin

◆ minimumSizeHint()

QSize QwtScaleWidget::minimumSizeHint ( ) const
overridevirtual

获取最小大小提示

◆ requestScaleRangeUpdate

void QwtScaleWidget::requestScaleRangeUpdate ( double  min,
double  max 
)
signal

坐标轴主动请求变更刻度范围

◆ resizeEvent()

void QwtScaleWidget::resizeEvent ( QResizeEvent *  event)
overrideprotectedvirtual

Event handler for resize events

参数
eventResize event

◆ scaleChange()

void QwtScaleWidget::scaleChange ( )
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.

◆ scaleColor()

QColor QwtScaleWidget::scaleColor ( ) const

获取坐标轴的颜色

返回
the scale color

◆ scaleDivChanged

void QwtScaleWidget::scaleDivChanged ( )
signal

当刻度分度发生变化时发出的信号

◆ scaleDraw() [1/2]

QwtScaleDraw * QwtScaleWidget::scaleDraw ( )

获取刻度绘制对象

返回
the scale draw

◆ scaleDraw() [2/2]

const QwtScaleDraw * QwtScaleWidget::scaleDraw ( ) const

获取刻度绘制对象(常量版本)

返回
the scale draw (const version)

◆ scaleRect()

QRect QwtScaleWidget::scaleRect ( ) const

获取用于绘制刻度的矩形区域(不包含 colorBar、margin、edgeMargin、borderDistHint)

返回
the scale rectangle (excluding color bar, margin, edge margin, border distances)

◆ selectedPenWidthOffset()

qreal QwtScaleWidget::selectedPenWidthOffset ( ) const

获取当前坐标轴在选中状态下的画笔宽度附加值

返回
the selected pen width offset

◆ selectionChanged

void QwtScaleWidget::selectionChanged ( bool  selected)
signal

当前轴被选中状态发生变化发射信号

◆ selectionColor()

QColor QwtScaleWidget::selectionColor ( ) const

获取选中的颜色

返回
the selection color

◆ setAlignment()

void QwtScaleWidget::setAlignment ( QwtScaleDraw::Alignment  alignment)

Set the alignment

更改对齐方式

◆ setBorderDist()

void QwtScaleWidget::setBorderDist ( int  dist1,
int  dist2 
)

Set the border distances

设置刻度两端与控件边框的距离

◆ setBuildinActions()

void QwtScaleWidget::setBuildinActions ( BuiltinActionsFlags  acts)

Enable/disable built-in actions

设置内置的动作

◆ setColorBarEnabled()

void QwtScaleWidget::setColorBarEnabled ( bool  on)

Enable/disable the color bar

启用/禁用与刻度关联的颜色条

◆ setColorBarWidth()

void QwtScaleWidget::setColorBarWidth ( int  width)

Set the color bar width

设置颜色条的宽度

◆ setColorMap()

void QwtScaleWidget::setColorMap ( const QwtInterval interval,
QwtColorMap colorMap 
)

Set the color map

设置用于显示颜色条的颜色映射和值区间

◆ setEdgeMargin()

void QwtScaleWidget::setEdgeMargin ( int  offset)

Set the edge margin (offset between axis and plot canvas)

设置坐标轴和绘图边缘的空白偏移距离

◆ setLabelAlignment()

void QwtScaleWidget::setLabelAlignment ( Qt::Alignment  alignment)

Set the label alignment

更改标签的对齐方式

◆ setLabelRotation()

void QwtScaleWidget::setLabelRotation ( double  rotation)

Set the label rotation

更改标签的旋转角度

◆ setLayoutFlag()

void QwtScaleWidget::setLayoutFlag ( LayoutFlag  flag,
bool  on 
)

Set a layout flag

切换布局标志

◆ setMargin()

void QwtScaleWidget::setMargin ( int  margin)

Set the margin

设置到颜色条/基线的边距

◆ setMinBorderDist()

void QwtScaleWidget::setMinBorderDist ( int  start,
int  end 
)

Set the minimum border distances

设置刻度两端与控件边框的最小距离

◆ setScaleColor()

void QwtScaleWidget::setScaleColor ( const QColor &  c)

Set the scale color (color of the coordinate axis)

设置坐标轴的颜色

◆ setScaleDiv()

void QwtScaleWidget::setScaleDiv ( const QwtScaleDiv scaleDiv)

Set the scale division

设置刻度划分

◆ setScaleDraw()

void QwtScaleWidget::setScaleDraw ( QwtScaleDraw scaleDraw)

Set the scale draw

设置刻度绘制对象

◆ setSelected()

void QwtScaleWidget::setSelected ( bool  selected)

Set the selected state

设置当前轴被选中

◆ setSelectedPenWidthOffset()

void QwtScaleWidget::setSelectedPenWidthOffset ( qreal  offset = 1)

Set the selected pen width offset

设置坐标轴在选中状态下的画笔宽度附加值

◆ setSelectionColor()

void QwtScaleWidget::setSelectionColor ( const QColor &  color)

Set the selection color

设置选中的颜色

◆ setSpacing()

void QwtScaleWidget::setSpacing ( int  spacing)

Set the spacing

设置颜色条、刻度和标题之间的距离

◆ setTextColor()

void QwtScaleWidget::setTextColor ( const QColor &  c)

Set the text color (font color of the coordinate axis)

设置坐标轴的字体颜色

◆ setTitle() [1/2]

void QwtScaleWidget::setTitle ( const QString &  title)

Set the title

设置标题的文本内容

◆ setTitle() [2/2]

void QwtScaleWidget::setTitle ( const QwtText title)

Set the title

设置标题的文本内容

◆ setTransformation()

void QwtScaleWidget::setTransformation ( QwtTransform transformation)

Set the transformation

设置变换

◆ setZoomFactor()

void QwtScaleWidget::setZoomFactor ( double  factor)

Set the zoom factor (default 1.2)

设置缩放因子(默认 1.2)

◆ sizeHint()

QSize QwtScaleWidget::sizeHint ( ) const
overridevirtual

获取大小提示

◆ spacing()

int QwtScaleWidget::spacing ( ) const

获取刻度和标题之间的距离

返回
the spacing

◆ startBorderDist()

int QwtScaleWidget::startBorderDist ( ) const

获取起始边框距离

返回
the start border distance

◆ startMinBorderDist()

int QwtScaleWidget::startMinBorderDist ( ) const

获取刻度两端与控件边框的最小距离(左侧或顶部)

返回
the start minimum border distance

◆ testBuildinActions()

bool QwtScaleWidget::testBuildinActions ( QwtScaleWidget::BuiltinActions  ba) const

检测内置动作是否激活

返回
true if a built-in action is active

◆ testLayoutFlag()

bool QwtScaleWidget::testLayoutFlag ( LayoutFlag  flag) const

测试布局标志

返回
true if a layout flag is set

◆ textColor()

QColor QwtScaleWidget::textColor ( ) const

获取坐标轴的字体颜色

返回
the text color

◆ title()

QwtText QwtScaleWidget::title ( ) const

获取标题

返回
the title

◆ titleHeightForWidth()

int QwtScaleWidget::titleHeightForWidth ( int  width) const

查找给定宽度下标题的高度

返回
the height required for the title for a given width

◆ zoomFactor()

double QwtScaleWidget::zoomFactor ( ) const

获取缩放因子

返回
the zoom factor

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