|
QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
|
Layout engine for QwtPlot components. More...
#include <qwt_plot_layout_engine.h>
Classes | |
| struct | Dimensions |
| Structure holding dimension values for layout calculation. More... | |
| class | LayoutData |
| Data structure for layout calculation. More... | |
Public Member Functions | |
| QwtPlotLayoutEngine () | |
| Default constructor for QwtPlotLayoutEngine. | |
| QRectF | layoutLegend (int plotLayoutOptions, const LayoutData::LegendData &legendData, const QRectF &rect, const QSize &legendHint) const |
| Calculate legend rectangle within available space. | |
| QRectF | alignLegend (const QSize &legendHint, const QRectF &canvasRect, const QRectF &legendRect) const |
| Align legend rectangle relative to canvas. | |
| void | alignScales (int plotLayoutOptions, const LayoutData &layoutData, QRectF &canvasRect, QRectF scaleRect[QwtAxis::AxisPositions]) const |
| Align scale rectangles with canvas. | |
| void | alignScalesToCanvas (int plotLayoutOptions, const LayoutData &layoutData, const QRectF &canvasRect, QRectF scaleRect[QwtAxis::AxisPositions]) const |
| Align scale rectangles to canvas boundaries. | |
| Dimensions | layoutDimensions (int plotLayoutOptions, const LayoutData &layoutData, const QRectF &rect) const |
| Iteratively calculate the layout dimensions for a QwtPlot. | |
| void | setSpacing (unsigned int spacing) |
| Set spacing value. | |
| unsigned int | spacing () const |
| Get spacing value. | |
| void | setAlignCanvas (int axisPos, bool on) |
| Set canvas alignment to scale for a specific axis position. | |
| bool | alignCanvas (int axisPos) const |
| Check if canvas is aligned to scale for a specific axis position. | |
| void | setCanvasMargin (int axisPos, int margin) |
| Set canvas margin for a specific axis position. | |
| int | canvasMargin (int axisPos) const |
| Get canvas margin for a specific axis position. | |
| void | setLegendPos (QwtPlot::LegendPosition pos) |
| Set the legend position. | |
| QwtPlot::LegendPosition | legendPos () const |
| Get the legend position. | |
| void | setLegendRatio (double ratio) |
| Set the legend ratio. | |
| double | legendRatio () const |
| Get the legend ratio. | |
Layout engine for QwtPlot components.
| QwtPlotLayoutEngine::QwtPlotLayoutEngine | ( | ) |
Default constructor for QwtPlotLayoutEngine.
| bool QwtPlotLayoutEngine::alignCanvas | ( | int | axisPos | ) | const |
Check if canvas is aligned to scale for a specific axis position.
| QRectF QwtPlotLayoutEngine::alignLegend | ( | const QSize & | legendHint, |
| const QRectF & | canvasRect, | ||
| const QRectF & | legendRect | ||
| ) | const |
Align legend rectangle relative to canvas.
| void QwtPlotLayoutEngine::alignScales | ( | int | plotLayoutOptions, |
| const LayoutData & | layoutData, | ||
| QRectF & | canvasRect, | ||
| QRectF | scaleRect[QwtAxis::AxisPositions] | ||
| ) | const |
Align scale rectangles with canvas.
对于X轴(水平轴): 检查左侧Y轴和右侧Y轴的影响 计算左右偏移量,考虑轴起始/结束距离和骨干偏移 调整X轴矩形位置,必要时调整画布矩形
对于Y轴(垂直轴): 检查底部X轴和顶部X轴的影响 计算上下偏移量,考虑轴起始/结束距离和骨干偏移 调整Y轴矩形位置,必要时调整画布矩形
当轴需要比可用空间更多的空间时,函数会调整画布矩形
在所有轴相互调整后,函数进行最终的对齐调整,确保轴与画布边缘正确对齐
| void QwtPlotLayoutEngine::alignScalesToCanvas | ( | int | plotLayoutOptions, |
| const LayoutData & | layoutData, | ||
| const QRectF & | canvasRect, | ||
| QRectF | scaleRect[QwtAxis::AxisPositions] | ||
| ) | const |
Align scale rectangles to canvas boundaries.
对于X轴(水平轴): 检查左侧Y轴和右侧Y轴的影响 计算左右偏移量,考虑轴起始/结束距离和骨干偏移 调整X轴矩形位置,必要时调整画布矩形
对于Y轴(垂直轴): 检查底部X轴和顶部X轴的影响 计算上下偏移量,考虑轴起始/结束距离和骨干偏移 调整Y轴矩形位置,必要时调整画布矩形
在所有轴相互调整后,函数进行最终的对齐调整,确保轴与画布边缘正确对齐
| int QwtPlotLayoutEngine::canvasMargin | ( | int | axisPos | ) | const |
Get canvas margin for a specific axis position.
| QwtPlotLayoutEngine::Dimensions QwtPlotLayoutEngine::layoutDimensions | ( | int | plotLayoutOptions, |
| const LayoutData & | layoutData, | ||
| const QRectF & | rect | ||
| ) | const |
Iteratively calculate the layout dimensions for a QwtPlot.
| QRectF QwtPlotLayoutEngine::layoutLegend | ( | int | plotLayoutOptions, |
| const LayoutData::LegendData & | legendData, | ||
| const QRectF & | rect, | ||
| const QSize & | legendHint | ||
| ) | const |
Calculate legend rectangle within available space.
| QwtPlot::LegendPosition QwtPlotLayoutEngine::legendPos | ( | ) | const |
Get the legend position.
| double QwtPlotLayoutEngine::legendRatio | ( | ) | const |
Get the legend ratio.
| void QwtPlotLayoutEngine::setAlignCanvas | ( | int | axisPos, |
| bool | on | ||
| ) |
Set canvas alignment to scale for a specific axis position.
| void QwtPlotLayoutEngine::setCanvasMargin | ( | int | axisPos, |
| int | margin | ||
| ) |
Set canvas margin for a specific axis position.
| void QwtPlotLayoutEngine::setLegendPos | ( | QwtPlot::LegendPosition | pos | ) |
Set the legend position.
| void QwtPlotLayoutEngine::setLegendRatio | ( | double | ratio | ) |
Set the legend ratio.
| void QwtPlotLayoutEngine::setSpacing | ( | unsigned int | spacing | ) |
Set spacing value.
| unsigned int QwtPlotLayoutEngine::spacing | ( | ) | const |
Get spacing value.