Scroll to navigation

QwtPlotLayout(3) Qwt User's Guide QwtPlotLayout(3)

NAME

QwtPlotLayout - Layout engine for QwtPlot.

SYNOPSIS

#include <qwt_plot_layout.h>

Public Types


enum Option { AlignScales = 0x01, IgnoreScrollbars = 0x02, IgnoreFrames = 0x04, IgnoreLegend = 0x08, IgnoreTitle = 0x10, IgnoreFooter = 0x20 }
typedef QFlags< Option > Options

Public Member Functions


QwtPlotLayout ()
Constructor. virtual ~QwtPlotLayout ()
Destructor. void setCanvasMargin (int margin, int axis=-1)
int canvasMargin (int axisId) const
void setAlignCanvasToScales (bool)
Set the align-canvas-to-axis-scales flag for all axes. void setAlignCanvasToScale (int axisId, bool)
bool alignCanvasToScale (int axisId) const
void setSpacing (int)
int spacing () const
void setLegendPosition (QwtPlot::LegendPosition pos, double ratio)
Specify the position of the legend. void setLegendPosition (QwtPlot::LegendPosition pos)
Specify the position of the legend. QwtPlot::LegendPosition legendPosition () const
void setLegendRatio (double ratio)
double legendRatio () const
virtual QSize minimumSizeHint (const QwtPlot *) const
virtual void activate (const QwtPlot *, const QRectF &plotRect, Options options=Options())
Recalculate the geometry of all components. virtual void invalidate ()
QRectF titleRect () const
QRectF footerRect () const
QRectF legendRect () const
QRectF scaleRect (QwtAxisId) const
QRectF canvasRect () const

Protected Member Functions


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.

Detailed Description

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()

Definition at line 27 of file qwt_plot_layout.h.

Member Typedef Documentation

typedef QFlags<Option > QwtPlotLayout::Options

An ORed combination of Option values.

Definition at line 58 of file qwt_plot_layout.h.

Member Enumeration Documentation

enum QwtPlotLayout::Option

Options to configure the plot layout engine

See also

activate(), QwtPlotRenderer

Enumerator

Unused.
Ignore the dimension of the scrollbars. There are no scrollbars, when the plot is not rendered to widgets.
Ignore all frames.
Ignore the legend.
Ignore the title.
Ignore the footer.

Definition at line 34 of file qwt_plot_layout.h.

Member Function Documentation

void QwtPlotLayout::activate (const QwtPlot * plot, const QRectF & plotRect, Options options = Options()) [virtual]

Recalculate the geometry of all components.

Parameters

plot Plot to be layout
plotRect Rectangle where to place the components
options Layout options

See also

invalidate(), titleRect(), footerRect() legendRect(), scaleRect(), canvasRect()

Definition at line 1508 of file qwt_plot_layout.cpp.

bool QwtPlotLayout::alignCanvasToScale (int axisPos) const

Return 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.

Parameters

axisPos Axis position

Returns

align-canvas-to-axis-scales setting

See also

setAlignCanvasToScale(), setAlignCanvasToScale(), setCanvasMargin()

Definition at line 1141 of file qwt_plot_layout.cpp.

int QwtPlotLayout::canvasMargin (int axisPos) const

Parameters

axisPos Axis position

Returns

Margin around the scale tick borders

See also

setCanvasMargin()

Definition at line 1089 of file qwt_plot_layout.cpp.

QRectF QwtPlotLayout::canvasRect () const

Returns

Geometry for the canvas

See also

activate(), invalidate()

Definition at line 1380 of file qwt_plot_layout.cpp.

QRectF QwtPlotLayout::footerRect () const

Returns

Geometry for the footer

See also

activate(), invalidate()

Definition at line 1304 of file qwt_plot_layout.cpp.

void QwtPlotLayout::invalidate () [virtual]

Invalidate the geometry of all components.

See also

activate()

Definition at line 1389 of file qwt_plot_layout.cpp.

QwtPlot::LegendPosition QwtPlotLayout::legendPosition () const

Returns

Position of the legend

See also

setLegendPosition(), QwtPlot::setLegendPosition(), QwtPlot::legendPosition()

Definition at line 1237 of file qwt_plot_layout.cpp.

double QwtPlotLayout::legendRatio () const

Returns

The relative size of the legend in the plot.

See also

setLegendPosition()

Definition at line 1260 of file qwt_plot_layout.cpp.

QRectF QwtPlotLayout::legendRect () const

Returns

Geometry for the legend

See also

activate(), invalidate()

Definition at line 1328 of file qwt_plot_layout.cpp.

QSize QwtPlotLayout::minimumSizeHint (const QwtPlot * plot) const [virtual]

Returns

Minimum size hint

Parameters

plot Plot widget

See also

QwtPlot::minimumSizeHint()

Definition at line 1404 of file qwt_plot_layout.cpp.

QRectF QwtPlotLayout::scaleRect (QwtAxisId axisId) const

Parameters

axisId Axis

Returns

Geometry for the scale

See also

activate(), invalidate()

Definition at line 1355 of file qwt_plot_layout.cpp.

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.

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

Definition at line 1126 of file qwt_plot_layout.cpp.

void QwtPlotLayout::setAlignCanvasToScales (bool on)

Set the align-canvas-to-axis-scales flag for all axes.

Parameters

on True/False

See also

setAlignCanvasToScale(), alignCanvasToScale()

Definition at line 1103 of file qwt_plot_layout.cpp.

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.

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

Definition at line 1066 of file qwt_plot_layout.cpp.

void QwtPlotLayout::setCanvasRect (const QRectF & rect) [protected]

Set the geometry for the canvas. This method is intended to be used from derived layouts overloading activate()

See also

canvasRect(), activate()

Definition at line 1371 of file qwt_plot_layout.cpp.

void QwtPlotLayout::setFooterRect (const QRectF & rect) [protected]

Set the geometry for the footer. This method is intended to be used from derived layouts overloading activate()

See also

footerRect(), activate()

Definition at line 1295 of file qwt_plot_layout.cpp.

void QwtPlotLayout::setLegendPosition (QwtPlot::LegendPosition pos)

Specify the position of the legend.

Parameters

pos The legend's position. Valid values are QwtPlot::LeftLegend, QwtPlot::RightLegend, QwtPlot::TopLegend, QwtPlot::BottomLegend.

See also

QwtPlot::setLegendPosition()

Definition at line 1227 of file qwt_plot_layout.cpp.

void QwtPlotLayout::setLegendPosition (QwtPlot::LegendPosition pos, double ratio)

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()

Definition at line 1183 of file qwt_plot_layout.cpp.

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.

Definition at line 1251 of file qwt_plot_layout.cpp.

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()

Definition at line 1319 of file qwt_plot_layout.cpp.

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()

Definition at line 1344 of file qwt_plot_layout.cpp.

void QwtPlotLayout::setSpacing (int spacing)

Change the spacing of the plot. The spacing is the distance between the plot components.

Parameters

spacing New spacing

See also

setCanvasMargin(), spacing()

Definition at line 1156 of file qwt_plot_layout.cpp.

void QwtPlotLayout::setTitleRect (const QRectF & rect) [protected]

Set the geometry for the title. This method is intended to be used from derived layouts overloading activate()

See also

titleRect(), activate()

Definition at line 1273 of file qwt_plot_layout.cpp.

int QwtPlotLayout::spacing () const

Returns

Spacing

See also

margin(), setSpacing()

Definition at line 1165 of file qwt_plot_layout.cpp.

QRectF QwtPlotLayout::titleRect () const

Returns

Geometry for the title

See also

activate(), invalidate()

Definition at line 1282 of file qwt_plot_layout.cpp.

Author

Generated automatically by Doxygen for Qwt User's Guide from the source code.

Sun Jul 18 2021 Version 6.2.0