|
QWT API (中文) 7.0.1
Qt绘图库 - 中文API文档
|
QwtPlot组件的布局引擎 更多...
#include <qwt_plot_layout_engine.h>
类 | |
| struct | Dimensions |
| 保存布局计算尺寸值的结构体 更多... | |
| class | LayoutData |
| 布局计算数据结构 更多... | |
Public 成员函数 | |
| QwtPlotLayoutEngine () | |
| QwtPlotLayoutEngine的默认构造函数 | |
| QRectF | layoutLegend (int plotLayoutOptions, const LayoutData::LegendData &legendData, const QRectF &rect, const QSize &legendHint) const |
| 在可用空间内计算图例矩形 | |
| QRectF | alignLegend (const QSize &legendHint, const QRectF &canvasRect, const QRectF &legendRect) const |
| 相对于画布对齐图例矩形 | |
| void | alignScales (int plotLayoutOptions, const LayoutData &layoutData, QRectF &canvasRect, QRectF scaleRect[QwtAxis::AxisPositions]) const |
| 将刻度矩形与画布对齐 | |
| void | alignScalesToCanvas (int plotLayoutOptions, const LayoutData &layoutData, const QRectF &canvasRect, QRectF scaleRect[QwtAxis::AxisPositions]) const |
| 将刻度矩形对齐到画布边界 | |
| Dimensions | layoutDimensions (int plotLayoutOptions, const LayoutData &layoutData, const QRectF &rect) const |
| 迭代计算QwtPlot的布局尺寸 | |
| void | setSpacing (unsigned int spacing) |
| 设置间距值 | |
| unsigned int | spacing () const |
| 获取间距值 | |
| void | setAlignCanvas (int axisPos, bool on) |
| 设置画布对齐到特定轴位置的刻度 | |
| bool | alignCanvas (int axisPos) const |
| 检查画布是否对齐到特定轴位置的刻度 | |
| void | setCanvasMargin (int axisPos, int margin) |
| 设置特定轴位置的画布边距 | |
| int | canvasMargin (int axisPos) const |
| 获取特定轴位置的画布边距 | |
| void | setLegendPos (QwtPlot::LegendPosition pos) |
| 设置图例位置 | |
| QwtPlot::LegendPosition | legendPos () const |
| 获取图例位置 | |
| void | setLegendRatio (double ratio) |
| 设置图例比例 | |
| double | legendRatio () const |
| 获取图例比例 | |
QwtPlot组件的布局引擎
| QwtPlotLayoutEngine::QwtPlotLayoutEngine | ( | ) |
QwtPlotLayoutEngine的默认构造函数
| bool QwtPlotLayoutEngine::alignCanvas | ( | int | axisPos | ) | const |
检查画布是否对齐到特定轴位置的刻度
| QRectF QwtPlotLayoutEngine::alignLegend | ( | const QSize & | legendHint, |
| const QRectF & | canvasRect, | ||
| const QRectF & | legendRect | ||
| ) | const |
相对于画布对齐图例矩形
| void QwtPlotLayoutEngine::alignScales | ( | int | plotLayoutOptions, |
| const LayoutData & | layoutData, | ||
| QRectF & | canvasRect, | ||
| QRectF | scaleRect[QwtAxis::AxisPositions] | ||
| ) | const |
将刻度矩形与画布对齐
对于X轴(水平轴): 检查左侧Y轴和右侧Y轴的影响 计算左右偏移量,考虑轴起始/结束距离和骨干偏移 调整X轴矩形位置,必要时调整画布矩形
对于Y轴(垂直轴): 检查底部X轴和顶部X轴的影响 计算上下偏移量,考虑轴起始/结束距离和骨干偏移 调整Y轴矩形位置,必要时调整画布矩形
当轴需要比可用空间更多的空间时,函数会调整画布矩形
在所有轴相互调整后,函数进行最终的对齐调整,确保轴与画布边缘正确对齐
| void QwtPlotLayoutEngine::alignScalesToCanvas | ( | int | plotLayoutOptions, |
| const LayoutData & | layoutData, | ||
| const QRectF & | canvasRect, | ||
| QRectF | scaleRect[QwtAxis::AxisPositions] | ||
| ) | const |
将刻度矩形对齐到画布边界
对于X轴(水平轴): 检查左侧Y轴和右侧Y轴的影响 计算左右偏移量,考虑轴起始/结束距离和骨干偏移 调整X轴矩形位置,必要时调整画布矩形
对于Y轴(垂直轴): 检查底部X轴和顶部X轴的影响 计算上下偏移量,考虑轴起始/结束距离和骨干偏移 调整Y轴矩形位置,必要时调整画布矩形
在所有轴相互调整后,函数进行最终的对齐调整,确保轴与画布边缘正确对齐
| int QwtPlotLayoutEngine::canvasMargin | ( | int | axisPos | ) | const |
获取特定轴位置的画布边距
| QwtPlotLayoutEngine::Dimensions QwtPlotLayoutEngine::layoutDimensions | ( | int | plotLayoutOptions, |
| const LayoutData & | layoutData, | ||
| const QRectF & | rect | ||
| ) | const |
迭代计算QwtPlot的布局尺寸
| QRectF QwtPlotLayoutEngine::layoutLegend | ( | int | plotLayoutOptions, |
| const LayoutData::LegendData & | legendData, | ||
| const QRectF & | rect, | ||
| const QSize & | legendHint | ||
| ) | const |
在可用空间内计算图例矩形
| QwtPlot::LegendPosition QwtPlotLayoutEngine::legendPos | ( | ) | const |
获取图例位置
| double QwtPlotLayoutEngine::legendRatio | ( | ) | const |
获取图例比例
| void QwtPlotLayoutEngine::setAlignCanvas | ( | int | axisPos, |
| bool | on | ||
| ) |
设置画布对齐到特定轴位置的刻度
| void QwtPlotLayoutEngine::setCanvasMargin | ( | int | axisPos, |
| int | margin | ||
| ) |
设置特定轴位置的画布边距
| void QwtPlotLayoutEngine::setLegendPos | ( | QwtPlot::LegendPosition | pos | ) |
设置图例位置
| void QwtPlotLayoutEngine::setLegendRatio | ( | double | ratio | ) |
设置图例比例
| void QwtPlotLayoutEngine::setSpacing | ( | unsigned int | spacing | ) |
设置间距值
| unsigned int QwtPlotLayoutEngine::spacing | ( | ) | const |
获取间距值