Layout engine for QwtPlot.
More...
#include <qwt_plot_layout.h>
|
| void | setTitleRect (const QRectF &) |
| | Set the geometry for the title.
|
| |
| void | setFooterRect (const QRectF &) |
| | Set the geometry for the footer.
|
| |
| void | setLegendRect (const QRectF &) |
| | Set the geometry for the legend.
|
| |
| void | setScaleRect (QwtAxisId, const QRectF &) |
| | Set the geometry for an axis.
|
| |
| void | setCanvasRect (const QRectF &) |
| | Set the geometry for the canvas.
|
| |
|
QwtPlotLayoutEngine * | layoutEngine () |
| |
| void | doActivate (const QwtPlot *plot, const QRectF &plotRect, Options options=Options()) |
| | QwtPlotLayout::activate的具体实现
|
| |
Layout engine for QwtPlot.
It is used by the QwtPlot widget to organize its internal widgets or by QwtPlot::print() to render its content to a QPaintDevice like a QPrinter, QPixmap/QImage or QSvgRenderer.
- See also
- QwtPlot::setPlotLayout()
◆ Option
Options to configure the plot layout engine.
- See also
- activate(), QwtPlotRenderer
| Enumerator |
|---|
| AlignScales | Unused.
|
| IgnoreScrollbars | Ignore the dimension of the scrollbars.
There are no scrollbars, when the plot is not rendered to widgets.
|
| IgnoreFrames | Ignore all frames.
|
| IgnoreLegend | Ignore the legend.
|
| IgnoreTitle | Ignore the title.
|
| IgnoreFooter | Ignore the footer.
|
◆ activate()
| void QwtPlotLayout::activate |
( |
const QwtPlot * |
plot, |
|
|
const QRectF & |
plotRect, |
|
|
Options |
options = Options() |
|
) |
| |
|
virtual |
◆ alignCanvasToScale()
| bool QwtPlotLayout::alignCanvasToScale |
( |
int |
axisPos | ) |
const |
◆ canvasMargin()
| int QwtPlotLayout::canvasMargin |
( |
int |
axisPos | ) |
const |
◆ canvasRect()
| QRectF QwtPlotLayout::canvasRect |
( |
| ) |
const |
◆ doActivate()
| void QwtPlotLayout::doActivate |
( |
const QwtPlot * |
plot, |
|
|
const QRectF & |
plotRect, |
|
|
Options |
options = Options() |
|
) |
| |
|
protected |
QwtPlotLayout::activate的具体实现
- Parameters
-
◆ footerRect()
| QRectF QwtPlotLayout::footerRect |
( |
| ) |
const |
◆ invalidate()
| void QwtPlotLayout::invalidate |
( |
| ) |
|
|
virtual |
Invalidate the geometry of all components.
- See also
- activate()
◆ legendPosition()
- Returns
- Position of the legend
- See also
- setLegendPosition(), QwtPlot::setLegendPosition(), QwtPlot::legendPosition()
◆ legendRatio()
| double QwtPlotLayout::legendRatio |
( |
| ) |
const |
◆ legendRect()
| QRectF QwtPlotLayout::legendRect |
( |
| ) |
const |
◆ minimumSizeHint()
| QSize QwtPlotLayout::minimumSizeHint |
( |
const QwtPlot * |
plot | ) |
const |
|
virtual |
◆ scaleRect()
| QRectF QwtPlotLayout::scaleRect |
( |
QwtAxisId |
axisId | ) |
const |
◆ setAlignCanvasToScale()
| void QwtPlotLayout::setAlignCanvasToScale |
( |
int |
axisPos, |
|
|
bool |
on |
|
) |
| |
Change the align-canvas-to-axis-scales setting.
The canvas may:
- extend beyond the axis scale ends to maximize its size,
- align with the axis scale ends to control its size.
The axisId parameter is somehow confusing as it identifies a border of the plot and not the axes, that are aligned. F.e when QwtAxis::YLeft is set, the left end of the the x-axes ( QwtAxis::XTop, QwtAxis::XBottom ) is aligned.
设置画布是否与坐标轴刻度对齐。画布有两种表现方式:
- 延伸:画布可超出轴刻度端点,以最大化绘图区域;
- 对齐:画布严格对齐轴刻度端点,以便精确控制大小。
【注意】参数 axisId 实际指代的是“绘图边框”,而非被对齐的轴本身。例如传入 QwtAxis::YLeft 时,真正被对齐的是两条 X 轴 (QwtAxis::XTop 与 QwtAxis::XBottom)的左端。
- Parameters
-
| axisId | Axis index |
| on | New align-canvas-to-axis-scales setting |
- See also
- setCanvasMargin(), alignCanvasToScale(), setAlignCanvasToScales()
- Warning
- In case of on == true canvasMargin() will have no effect
◆ setAlignCanvasToScales()
| void QwtPlotLayout::setAlignCanvasToScales |
( |
bool |
on | ) |
|
◆ setCanvasMargin()
| void QwtPlotLayout::setCanvasMargin |
( |
int |
margin, |
|
|
int |
axisPos = -1 |
|
) |
| |
Change a margin of the canvas.
The margin is the space above/below the scale ticks. A negative margin will be set to -1, excluding the borders of the scales.
设置画布的边距(margin)。这个边距是指 坐标轴刻度线与画布边缘之间的空间
正数:在刻度线外增加空白区域 负数:会被设置为-1,表示排除坐标轴边框的影响 0:紧贴刻度线
- Parameters
-
| margin | New margin |
| axisPos | One of QwtAxis::Position. Specifies where the position of the margin. -1 means margin at all borders. |
- See also
- canvasMargin()
- Warning
- The margin will have no effect when alignCanvasToScale() is true
◆ setCanvasRect()
| void QwtPlotLayout::setCanvasRect |
( |
const QRectF & |
rect | ) |
|
|
protected |
◆ setFooterRect()
| void QwtPlotLayout::setFooterRect |
( |
const QRectF & |
rect | ) |
|
|
protected |
◆ setLegendPosition() [1/2]
Specify the position of the legend.
- Parameters
-
- See also
- QwtPlot::setLegendPosition()
◆ setLegendPosition() [2/2]
Specify the position of the legend.
- Parameters
-
| pos | The legend's position. |
| ratio | Ratio between legend and the bounding rectangle of title, footer, canvas and axes. The legend will be shrunk if it would need more space than the given ratio. The ratio is limited to ]0.0 .. 1.0]. In case of <= 0.0 it will be reset to the default ratio. The default vertical/horizontal ratio is 0.33/0.5. |
- See also
- QwtPlot::setLegendPosition()
◆ setLegendRatio()
| void QwtPlotLayout::setLegendRatio |
( |
double |
ratio | ) |
|
Specify the relative size of the legend in the plot.
- Parameters
-
| ratio | Ratio between legend and the bounding rectangle of title, footer, canvas and axes. The legend will be shrunk if it would need more space than the given ratio. The ratio is limited to ]0.0 .. 1.0]. In case of <= 0.0 it will be reset to the default ratio. The default vertical/horizontal ratio is 0.33/0.5. |
◆ setLegendRect()
| void QwtPlotLayout::setLegendRect |
( |
const QRectF & |
rect | ) |
|
|
protected |
Set the geometry for the legend.
This method is intended to be used from derived layouts overloading activate()
- Parameters
-
| rect | Rectangle for the legend |
- See also
- legendRect(), activate()
◆ setScaleRect()
| void QwtPlotLayout::setScaleRect |
( |
QwtAxisId |
axisId, |
|
|
const QRectF & |
rect |
|
) |
| |
|
protected |
Set the geometry for an axis.
This method is intended to be used from derived layouts overloading activate()
- Parameters
-
| axisId | Axis |
| rect | Rectangle for the scale |
- See also
- scaleRect(), activate()
◆ setSpacing()
| void QwtPlotLayout::setSpacing |
( |
int |
spacing | ) |
|
Change the spacing of the plot.
The spacing is the distance between the plot components.
- Parameters
-
- See also
- setCanvasMargin(), spacing()
◆ setTitleRect()
| void QwtPlotLayout::setTitleRect |
( |
const QRectF & |
rect | ) |
|
|
protected |
◆ spacing()
| int QwtPlotLayout::spacing |
( |
| ) |
const |
◆ titleRect()
| QRectF QwtPlotLayout::titleRect |
( |
| ) |
const |
The documentation for this class was generated from the following files:
- /home/runner/work/QWT/QWT/src/qwt_plot_layout.h
- /home/runner/work/QWT/QWT/src/qwt_plot_layout.cpp