QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
QwtPlotLayoutEngine::Dimensions Struct Reference

Structure holding dimension values for layout calculation. More...

#include <qwt_plot_layout_engine.h>

Public Member Functions

 Dimensions ()
 Constructor for Dimensions structure.
 
int dimAxis (QwtAxisId axisId) const
 Get the stored dimension for a given axis.
 
void setDimAxis (QwtAxisId axisId, int dim)
 Set the stored dimension for a given axis.
 
int dimAxes (int axisPos) const
 Read dimension by axis position index.
 
int captionExtra (int axisPos) const
 Read the extra caption band pixels for an axis position.
 
void setCaptionExtra (int axisPos, int extra)
 Set the extra caption band pixels for an axis position.
 
int dimYAxes () const
 Sum width of left and right Y axes.
 
int dimXAxes () const
 Sum height of top and bottom X axes.
 
QRectF centered (const QRectF &rect, const QRectF &labelRect) const
 Center a label rectangle within available space.
 
QRectF innerRect (const QRectF &rect) const
 Calculate inner rectangle after accounting for axis dimensions.
 

Public Attributes

int dimTitle
 
int dimFooter
 

Detailed Description

Structure holding dimension values for layout calculation.

Contains width/height values for title, footer, and all four axes.

Constructor & Destructor Documentation

◆ Dimensions()

QwtPlotLayoutEngine::Dimensions::Dimensions ( )

Constructor for Dimensions structure.

Initializes all dimension values to zero for title, footer, and all axis positions.

Member Function Documentation

◆ captionExtra()

int QwtPlotLayoutEngine::Dimensions::captionExtra ( int  axisPos) const

Read the extra caption band pixels for an axis position.

Parameters
axisPosAxis position enum value (YLeft, YRight, XTop, XBottom)
Returns
Extra pixels reserved beyond the scale dimension, 0 if none

◆ centered()

QRectF QwtPlotLayoutEngine::Dimensions::centered ( const QRectF &  rect,
const QRectF &  labelRect 
) const

Center a label rectangle within available space.

Adjusts the label rectangle to be centered horizontally within the available space after accounting for Y axis dimensions.

Parameters
rectThe available rectangle
labelRectThe label rectangle to center
Returns
Centered label rectangle

◆ dimAxes()

int QwtPlotLayoutEngine::Dimensions::dimAxes ( int  axisPos) const

Read dimension by axis position index.

Includes the extra caption band reserved for outside axis titles (QwtScaleWidget::TitleOutside), so that innerRect() and the axis length calculations see the full band.

Parameters
axisPosAxis position enum value (YLeft, YRight, XTop, XBottom)
Returns
Pixel size of the band at the given position

◆ dimAxis()

int QwtPlotLayoutEngine::Dimensions::dimAxis ( QwtAxisId  axisId) const

Get the stored dimension for a given axis.

Parameters
axisIdAxis identifier (QwtAxis::XTop, XBottom, YLeft, YRight)
Returns
The reserved pixels for this axis

◆ dimXAxes()

int QwtPlotLayoutEngine::Dimensions::dimXAxes ( ) const

Sum height of top and bottom X axes.

Returns
Combined height in pixels

◆ dimYAxes()

int QwtPlotLayoutEngine::Dimensions::dimYAxes ( ) const

Sum width of left and right Y axes.

Returns
Combined width in pixels

◆ innerRect()

QRectF QwtPlotLayoutEngine::Dimensions::innerRect ( const QRectF &  rect) const

Calculate inner rectangle after accounting for axis dimensions.

Calculates the available space for the canvas after reserving space for all axes.

Parameters
rectThe outer rectangle
Returns
Inner rectangle for canvas

◆ setCaptionExtra()

void QwtPlotLayoutEngine::Dimensions::setCaptionExtra ( int  axisPos,
int  extra 
)

Set the extra caption band pixels for an axis position.

Parameters
axisPosAxis position enum value (YLeft, YRight, XTop, XBottom)
extraExtra pixels reserved beyond the scale dimension

◆ setDimAxis()

void QwtPlotLayoutEngine::Dimensions::setDimAxis ( QwtAxisId  axisId,
int  dim 
)

Set the stored dimension for a given axis.

Parameters
axisIdAxis identifier
dimNew dimension in pixels

The documentation for this struct was generated from the following files: