Layout engine for QwtPlot
更多...
#include <qwt_plot_layout.h>
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.
- 参见
- QwtPlot::setPlotLayout()
◆ Option
Options to configure the plot layout engine
- 参见
- activate(), QwtPlotRenderer
| 枚举值 |
|---|
| 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
|
◆ QwtPlotLayout()
| QwtPlotLayout::QwtPlotLayout |
( |
| ) |
|
|
explicit |
Constructor
Creates a new QwtPlotLayout instance with default settings. The legend position is set to BottomLegend and canvas margin is set to -1.
Destructor
Destroys the QwtPlotLayout instance and releases all allocated resources.
◆ activate()
| void QwtPlotLayout::activate |
( |
const QwtPlot * |
plot, |
|
|
const QRectF & |
plotRect, |
|
|
Options |
options = Options() |
|
) |
| |
|
virtual |
Recalculate the geometry of all plot components
- 参数
-
| plot | The plot widget to layout |
| plotRect | The rectangle where to place the components (in pixels) |
| options | Layout options (e.g., ignore legend, ignore specific axes) |
Calculates and stores the geometry for all sub-components (title, footer, legend, 4 axes, and canvas). Results are stored internally and can be retrieved via titleRect(), footerRect(), legendRect(), canvasRect(), and scaleRect().
- 参见
- invalidate(), titleRect(), footerRect(), legendRect(), scaleRect(), canvasRect()
被 QwtParasitePlotLayout 重载.
◆ alignCanvasToScale()
| bool QwtPlotLayout::alignCanvasToScale |
( |
int |
axisPos | ) |
const |
◆ canvasMargin()
| int QwtPlotLayout::canvasMargin |
( |
int |
axisPos | ) |
const |
Get the canvas margin for a specific axis position
- 参数
-
- 返回
- The margin around the scale tick borders for the specified axis
- 参见
- setCanvasMargin()
◆ canvasRect()
| QRectF QwtPlotLayout::canvasRect |
( |
| ) |
const |
◆ doActivate()
| void QwtPlotLayout::doActivate |
( |
const QwtPlot * |
plot, |
|
|
const QRectF & |
plotRect, |
|
|
Options |
options = Options() |
|
) |
| |
|
protected |
◆ footerRect()
| QRectF QwtPlotLayout::footerRect |
( |
| ) |
const |
◆ invalidate()
| void QwtPlotLayout::invalidate |
( |
| ) |
|
|
virtual |
Invalidate the geometry of all components
Resets all geometry rectangles (title, footer, legend, canvas, and scales) to empty rectangles. Must call activate() to recalculate geometries.
- 参见
- activate()
◆ legendPosition()
Get the legend position
- 返回
- The current legend position
- 参见
- 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 |
|
) |
| |
Set the align-canvas-to-axis-scales setting for a specific axis
- 参数
-
| axisPos | Axis position. This identifies a border of the plot. For example, QwtAxis::YLeft aligns the left end of X-axes. |
| on | True to align canvas to scales, false to extend beyond scale ends |
The canvas may either extend beyond the axis scale ends to maximize its size, or align with the axis scale ends to control its size.
- 注解
- When on is true, canvasMargin() has no effect
- 参见
- setAlignCanvasToScales(), alignCanvasToScale(), setCanvasMargin()
◆ setAlignCanvasToScales()
| void QwtPlotLayout::setAlignCanvasToScales |
( |
bool |
on | ) |
|
◆ setCanvasMargin()
| void QwtPlotLayout::setCanvasMargin |
( |
int |
margin, |
|
|
int |
axisPos = -1 |
|
) |
| |
Set the canvas margin for a specific axis position
- 参数
-
| margin | The margin value. A negative margin (-1) excludes scale borders. Positive values add space between scale ticks and canvas edge. 0 means tight against tick marks. |
| axisPos | Axis position (QwtAxis::Position). Use -1 to apply to all axes. |
The margin is the space above/below the scale ticks. When alignCanvasToScale() is true, the margin has no effect.
- 参见
- canvasMargin(), setAlignCanvasToScale()
◆ setCanvasRect()
| void QwtPlotLayout::setCanvasRect |
( |
const QRectF & |
rect | ) |
|
|
protected |
◆ setFooterRect()
| void QwtPlotLayout::setFooterRect |
( |
const QRectF & |
rect | ) |
|
|
protected |
◆ setLegendPosition() [1/2]
◆ setLegendPosition() [2/2]
Set the legend position with a specified ratio
- 参数
-
| pos | The legend position (LeftLegend, RightLegend, TopLegend, BottomLegend) |
| ratio | Ratio between legend and the bounding rectangle of title, footer, canvas and axes. Limited to (0.0, 1.0]. Values <= 0.0 use defaults. Default vertical/horizontal ratio is 0.33/0.5. |
- 参见
- legendPosition(), setLegendRatio(), QwtPlot::setLegendPosition()
◆ setLegendRatio()
| void QwtPlotLayout::setLegendRatio |
( |
double |
ratio | ) |
|
Set the relative size of the legend in the plot
- 参数
-
| ratio | Ratio between legend and the bounding rectangle of title, footer, canvas and axes. Limited to (0.0, 1.0]. Values <= 0.0 use defaults. Default vertical/horizontal ratio is 0.33/0.5. |
- 参见
- legendRatio(), setLegendPosition()
◆ 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()
- 参数
-
| rect | Rectangle for the legend |
- 参见
- 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()
- 参数
-
| axisId | Axis |
| rect | Rectangle for the scale |
- 参见
- scaleRect(), activate()
◆ setSpacing()
| void QwtPlotLayout::setSpacing |
( |
int |
spacing | ) |
|
◆ setTitleRect()
| void QwtPlotLayout::setTitleRect |
( |
const QRectF & |
rect | ) |
|
|
protected |
◆ spacing()
| int QwtPlotLayout::spacing |
( |
| ) |
const |
◆ titleRect()
| QRectF QwtPlotLayout::titleRect |
( |
| ) |
const |
该类的文档由以下文件生成:
- /home/runner/work/QWT/QWT/src/plot/qwt_plot_layout.h
- /home/runner/work/QWT/QWT/src/plot/qwt_plot_layout.cpp