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 }
 
typedef QFlags< Option > Options
 

Public Member Functions


QwtPlotLayout ()
 
virtual ~QwtPlotLayout ()
 
void setCanvasMargin (int margin, int axis=-1)
 
int canvasMargin (int axis) const
 
void setAlignCanvasToScales (bool)
 
bool alignCanvasToScales () const
 
void setSpacing (int)
 
int spacing () const
 
void setLegendPosition (QwtPlot::LegendPosition pos, double ratio)
 
void setLegendPosition (QwtPlot::LegendPosition pos)
 
QwtPlot::LegendPosition legendPosition () const
 
void setLegendRatio (double ratio)
 
double legendRatio () const
 
virtual QSize minimumSizeHint (const QwtPlot *) const
 
virtual void activate (const QwtPlot *, const QRectF &rect, Options options=0x00)
 
virtual void invalidate ()
 
const QRectF & titleRect () const
 
const QRectF & legendRect () const
 
const QRectF & scaleRect (int axis) const
 
const QRectF & canvasRect () const
 

Protected Member Functions


QRectF layoutLegend (Options options, const QRectF &) const
 
QRectF alignLegend (const QRectF &canvasRect, const QRectF &legendRect) const
 
void expandLineBreaks (int options, const QRectF &rect, int &dimTitle, int dimAxes[QwtPlot::axisCnt]) const
 
void alignScales (int options, QRectF &canvasRect, QRectF scaleRect[QwtPlot::axisCnt]) const
 

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.

Member Typedef Documentation

typedef QFlags<Option> QwtPlotLayout::Options

Layout options.

Member Enumeration Documentation

enum QwtPlotLayout::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.

Constructor & Destructor Documentation

QwtPlotLayout::QwtPlotLayout () [explicit]

Constructor.

QwtPlotLayout::~QwtPlotLayout () [virtual]

Destructor.

Member Function Documentation

void QwtPlotLayout::activate (const QwtPlot *plot, const QRectF &plotRect, Optionsoptions = 0x00) [virtual]

Recalculate the geometry of all components. Parameters:
plot Plot to be layout
 
plotRect Rect where to place the components
 
options Layout options
See also:
invalidate(), titleRect(), legendRect(), scaleRect(), canvasRect()
 

bool QwtPlotLayout::alignCanvasToScales () 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.
Returns:
align-canvas-to-axis-scales setting
See also:
setAlignCanvasToScales, setCanvasMargin()
Note:
In this context the term 'scale' means the backbone of a scale.
 

QRectF QwtPlotLayout::alignLegend (const QRectF &canvasRect, const QRectF &legendRect) const [protected] Align the legend to the canvas

Parameters:
canvasRect Geometry of the canvas
 
legendRect Maximum geometry for the legend
Returns:
Geometry for the aligned legend
 

void QwtPlotLayout::alignScales (intoptions, QRectF &canvasRect, QRectFscaleRect[QwtPlot::axisCnt]) const [protected] Align the ticks of the axis to the canvas borders using the empty corners.

See also:
Options
 

int QwtPlotLayout::canvasMargin (intaxis) const Returns:

Margin around the scale tick borders
See also:
setCanvasMargin()
 

const QRectF & QwtPlotLayout::canvasRect () const Returns:

Geometry for the canvas
See also:
activate(), invalidate()
 

void QwtPlotLayout::expandLineBreaks (intoptions, const QRectF &rect, int &dimTitle, intdimAxis[QwtPlot::axisCnt]) const [protected] Expand all line breaks in text labels, and calculate the height of their widgets in orientation of the text.

Parameters:
options Options how to layout the legend
 
rect Bounding rect for title, axes and canvas.
 
dimTitle Expanded height of the title widget
 
dimAxis Expanded heights of the axis in axis orientation.
See also:
Options
 

void QwtPlotLayout::invalidate () [virtual] Invalidate the geometry of all components.

See also:
activate()
 

QRectF QwtPlotLayout::layoutLegend (Optionsoptions, const QRectF &rect) const [protected] Find the geometry for the legend

Parameters:
options Options how to layout the legend
 
rect Rectangle where to place the legend
Returns:
Geometry for the legend
See also:
Options
 

QwtPlot::LegendPosition QwtPlotLayout::legendPosition () const Returns:

Position of the legend
See also:
setLegendPosition(), QwtPlot::setLegendPosition(), QwtPlot::legendPosition()
 

double QwtPlotLayout::legendRatio () const Returns:

The relative size of the legend in the plot.
See also:
setLegendPosition()
 

const QRectF & QwtPlotLayout::legendRect () const Returns:

Geometry for the legend
See also:
activate(), invalidate()
 

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

Return a minimum size hint. See also:
QwtPlot::minimumSizeHint()
 

const QRectF & QwtPlotLayout::scaleRect (intaxis) const Parameters:

axis Axis index
Returns:
Geometry for the scale
See also:
activate(), invalidate()
 

void QwtPlotLayout::setAlignCanvasToScales (boolalignCanvasToScales) 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.
Parameters:
alignCanvasToScales New align-canvas-to-axis-scales setting
See also:
setCanvasMargin()
Note:
In this context the term 'scale' means the backbone of a scale.
Warning:
In case of alignCanvasToScales == true canvasMargin will have no effect
 

void QwtPlotLayout::setCanvasMargin (intmargin, intaxis = -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
 
axis One of QwtPlot::Axis. Specifies where the position of the margin. -1 means margin at all borders.
See also:
canvasMargin()
Warning:
The margin will have no effect when alignCanvasToScales is true
 

void QwtPlotLayout::setLegendPosition (QwtPlot::LegendPositionpos)

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

void QwtPlotLayout::setLegendPosition (QwtPlot::LegendPositionpos, doubleratio)

Specify the position of the legend. Parameters:
pos The legend's position.
 
ratio Ratio between legend and the bounding rect of title, canvas and axes. The legend will be shrinked 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()
 

void QwtPlotLayout::setLegendRatio (doubleratio) Specify the relative size of the legend in the plot

Parameters:
ratio Ratio between legend and the bounding rect of title, canvas and axes. The legend will be shrinked 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.
 

void QwtPlotLayout::setSpacing (intspacing) Change the spacing of the plot. The spacing is the distance between the plot components.

Parameters:
spacing new spacing
See also:
setMargin(), spacing()
 

int QwtPlotLayout::spacing () const Returns:

spacing
See also:
margin(), setSpacing()
 

const QRectF & QwtPlotLayout::titleRect () const Returns:

Geometry for the title
See also:
activate(), invalidate()
 
 

Author

Generated automatically by Doxygen for Qwt User's Guide from the source code.
Fri Apr 15 2011 Version 6.0.0