QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
Loading...
Searching...
No Matches
Classes | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
QwtFigure Class Reference

A figure container for organizing Qwt plots with flexible layout options. More...

#include <qwt_figure.h>

Inheritance diagram for QwtFigure:

Classes

class  PrivateData
 

Signals

void axesAdded (QwtPlot *newAxes)
 Signal emitted when axes are added to the figure.
 
void axesRemoved (QwtPlot *removedAxes)
 Signal emitted when axes are removed from the figure.
 
void figureCleared ()
 Signal emitted when the figure is cleared .
 
void currentAxesChanged (QwtPlot *current)
 Signal emitted when the current active axes changes.
 

Public Member Functions

 QwtFigure (QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
 Constructor.
 
void addWidget (QWidget *widget, qreal left, qreal top, qreal width, qreal height)
 Add a widget with normalized coordinates.
 
void addWidget (QWidget *widget, int rowCnt, int colCnt, int row, int col, int rowSpan=1, int colSpan=1, qreal wspace=0.0, qreal hspace=0.0)
 Add a widget by grid layout.
 
void addAxes (QwtPlot *plot, const QRectF &rect)
 Add a plot with normalized coordinates.
 
void addAxes (QwtPlot *plot, qreal left, qreal top, qreal width, qreal height)
 Add a plot with normalized coordinates using separate parameters.
 
void addGridAxes (QwtPlot *plot, int rowCnt, int colCnt, int row, int col, int rowSpan=1, int colSpan=1, qreal wspace=0.0, qreal hspace=0.0)
 Add a plot by grid layout.
 
void setWidgetNormPos (QWidget *widget, const QRectF &rect)
 改变已经添加的窗口的位置占比,如果窗口还没添加,此函数无效
 
QList< QwtPlot * > allAxes (bool byZOrder=false) const
 Get all axes (plots) in the figure (not including parasite axes)
 
bool hasAxes () const
 Check if the figure has any axes.
 
bool hasAxes (QwtPlot *plot) const
 Check if the figure contains a specific plot.
 
void removeAxes (QwtPlot *plot)
 Remove a specific axes (plot) from the figure.
 
bool takeAxes (QwtPlot *plot)
 Take a specific axes (plot) from the figure without deleting it.
 
void clear ()
 Clear all axes from the figure.
 
QSize getSizeInches () const
 Get the size of the figure in inches.
 
void setSizeInches (float width, float height)
 Set the size of the figure in inches.
 
void setSizeInches (const QSizeF &size)
 Set the size of the figure in inches.
 
void setFaceColor (const QColor &color)
 Set the face color of the figure.
 
QColor faceColor () const
 Get the face color of the figure.
 
void setFaceBrush (const QBrush &brush)
 Set the face brush of the figure.
 
QBrush faceBrush () const
 Get the face brush of the figure.
 
void setEdgeColor (const QColor &color)
 Set the edge color of the figure.
 
QColor edgeColor () const
 Get the edge color of the figure.
 
void setEdgeLineWidth (int width)
 Set the edge line width of the figure.
 
int edgeLineWidth () const
 Get the edge line width of the figure.
 
QwtPlotcreateParasiteAxes (QwtPlot *hostPlot, QwtAxis::Position enableAxis)
 Create parasite axes for a host plot.
 
QList< QwtPlot * > getParasiteAxes (QwtPlot *hostPlot) const
 Get all parasite axes for a host plot.
 
QPixmap saveFig (int dpi=-1) const
 Save the figure to a QPixmap with specified DPI.
 
QPixmap saveFig (QSizeF &inchesSize) const
 Save the figure to a QPixmap with specified size in inches.
 
bool saveFig (const QString &filename, int dpi=-1) const
 Save the figure to a file with specified DPI.
 
void setCurrentAxes (QwtPlot *plot)
 Set the current axes (plot)
 
void sca (QwtPlot *plot)
 Set the current axes (plot)
 
QwtPlotcurrentAxes () const
 Get the current axes (plot)
 
QwtPlotgca () const
 Get the current axes (plot)
 
QRectF axesNormRect (QwtPlot *plot) const
 Get the normalized rectangle for a axes.
 
QRectF widgetNormRect (QWidget *w) const
 Get the normalized rectangle for a widget.
 
QwtPlotplotUnderPos (const QPoint &pos) const
 Get the plot under a position.
 
QRectF calcNormRect (const QRect &geoRect) const
 Calculate normalized coordinates from actual window coordinates.
 
QRect calcActualRect (const QRectF &normRect)
 Calculate actual rectangle from normalized coordinates.
 
void replotAll ()
 Update all plots in the figure.
 
void addAxisAlignment (const QList< QwtPlot * > &plots, int axisId)
 Add axis alignment configuration.
 
bool removeAxisAlignment (const QList< QwtPlot * > &plots, int axisId)
 Remove specified axis alignment configuration.
 
void clearAxisAlignment ()
 Clear all axis alignment configurations.
 
void applyAllAxisAlignments (bool replot=true)
 Apply all axis alignment configurations.
 
void applyAlignmentsForAxis (int axisId)
 Apply alignment configurations for a specific axis.
 
int axisAligmentCount () const
 Get the number of axis alignment configurations.
 
QPair< QList< QwtPlot * >, int > axisAligmentInfo (int index) const
 Get axis alignment information by index.
 

Static Public Member Functions

static void alignAxes (QList< QwtPlot * > plots, int axisId, bool update=true)
 Align axes of multiple plots.
 

Protected Member Functions

void paintEvent (QPaintEvent *event) override
 
void resizeEvent (QResizeEvent *event) override
 

Detailed Description

A figure container for organizing Qwt plots with flexible layout options.

Constructor & Destructor Documentation

◆ QwtFigure()

QwtFigure::QwtFigure ( QWidget *  parent = nullptr,
Qt::WindowFlags  f = Qt::WindowFlags() 
)

Constructor.

Member Function Documentation

◆ addAxes() [1/2]

void QwtFigure::addAxes ( QwtPlot plot,
const QRectF &  rect 
)

Add a plot with normalized coordinates.

◆ addAxes() [2/2]

void QwtFigure::addAxes ( QwtPlot plot,
qreal  left,
qreal  top,
qreal  width,
qreal  height 
)

Add a plot with normalized coordinates using separate parameters.

◆ addAxisAlignment()

void QwtFigure::addAxisAlignment ( const QList< QwtPlot * > &  plots,
int  axisId 
)

Add axis alignment configuration.

◆ addGridAxes()

void QwtFigure::addGridAxes ( QwtPlot plot,
int  rowCnt,
int  colCnt,
int  row,
int  col,
int  rowSpan = 1,
int  colSpan = 1,
qreal  wspace = 0.0,
qreal  hspace = 0.0 
)

Add a plot by grid layout.

◆ addWidget() [1/2]

void QwtFigure::addWidget ( QWidget *  widget,
int  rowCnt,
int  colCnt,
int  row,
int  col,
int  rowSpan = 1,
int  colSpan = 1,
qreal  wspace = 0.0,
qreal  hspace = 0.0 
)

Add a widget by grid layout.

◆ addWidget() [2/2]

void QwtFigure::addWidget ( QWidget *  widget,
qreal  left,
qreal  top,
qreal  width,
qreal  height 
)

Add a widget with normalized coordinates.

◆ alignAxes()

void QwtFigure::alignAxes ( QList< QwtPlot * >  plots,
int  axisId,
bool  update = true 
)
static

Align axes of multiple plots.

◆ allAxes()

QList< QwtPlot * > QwtFigure::allAxes ( bool  byZOrder = false) const

Get all axes (plots) in the figure (not including parasite axes)

◆ applyAlignmentsForAxis()

void QwtFigure::applyAlignmentsForAxis ( int  axisId)

Apply alignment configurations for a specific axis.

◆ applyAllAxisAlignments()

void QwtFigure::applyAllAxisAlignments ( bool  replot = true)

Apply all axis alignment configurations.

◆ axesAdded

void QwtFigure::axesAdded ( QwtPlot newAxes)
signal

Signal emitted when axes are added to the figure.

◆ axesNormRect()

QRectF QwtFigure::axesNormRect ( QwtPlot plot) const

Get the normalized rectangle for a axes.

◆ axesRemoved

void QwtFigure::axesRemoved ( QwtPlot removedAxes)
signal

Signal emitted when axes are removed from the figure.

◆ axisAligmentCount()

int QwtFigure::axisAligmentCount ( ) const

Get the number of axis alignment configurations.

◆ axisAligmentInfo()

QPair< QList< QwtPlot * >, int > QwtFigure::axisAligmentInfo ( int  index) const

Get axis alignment information by index.

◆ calcActualRect()

QRect QwtFigure::calcActualRect ( const QRectF &  normRect)

Calculate actual rectangle from normalized coordinates.

◆ calcNormRect()

QRectF QwtFigure::calcNormRect ( const QRect &  geoRect) const

Calculate normalized coordinates from actual window coordinates.

◆ clear()

void QwtFigure::clear ( )

Clear all axes from the figure.

◆ clearAxisAlignment()

void QwtFigure::clearAxisAlignment ( )

Clear all axis alignment configurations.

◆ createParasiteAxes()

QwtPlot * QwtFigure::createParasiteAxes ( QwtPlot hostPlot,
QwtAxis::Position  enableAxis 
)

Create parasite axes for a host plot.

◆ currentAxes()

QwtPlot * QwtFigure::currentAxes ( ) const

Get the current axes (plot)

◆ currentAxesChanged

void QwtFigure::currentAxesChanged ( QwtPlot current)
signal

Signal emitted when the current active axes changes.

◆ edgeColor()

QColor QwtFigure::edgeColor ( ) const

Get the edge color of the figure.

◆ edgeLineWidth()

int QwtFigure::edgeLineWidth ( ) const

Get the edge line width of the figure.

◆ faceBrush()

QBrush QwtFigure::faceBrush ( ) const

Get the face brush of the figure.

◆ faceColor()

QColor QwtFigure::faceColor ( ) const

Get the face color of the figure.

◆ figureCleared

void QwtFigure::figureCleared ( )
signal

Signal emitted when the figure is cleared .

◆ gca()

QwtPlot * QwtFigure::gca ( ) const

Get the current axes (plot)

◆ getParasiteAxes()

QList< QwtPlot * > QwtFigure::getParasiteAxes ( QwtPlot hostPlot) const

Get all parasite axes for a host plot.

◆ getSizeInches()

QSize QwtFigure::getSizeInches ( ) const

Get the size of the figure in inches.

◆ hasAxes() [1/2]

bool QwtFigure::hasAxes ( ) const

Check if the figure has any axes.

◆ hasAxes() [2/2]

bool QwtFigure::hasAxes ( QwtPlot plot) const

Check if the figure contains a specific plot.

◆ plotUnderPos()

QwtPlot * QwtFigure::plotUnderPos ( const QPoint &  pos) const

Get the plot under a position.

◆ removeAxes()

void QwtFigure::removeAxes ( QwtPlot plot)

Remove a specific axes (plot) from the figure.

◆ removeAxisAlignment()

bool QwtFigure::removeAxisAlignment ( const QList< QwtPlot * > &  plots,
int  axisId 
)

Remove specified axis alignment configuration.

◆ replotAll()

void QwtFigure::replotAll ( )

Update all plots in the figure.

◆ saveFig() [1/3]

bool QwtFigure::saveFig ( const QString &  filename,
int  dpi = -1 
) const

Save the figure to a file with specified DPI.

◆ saveFig() [2/3]

QPixmap QwtFigure::saveFig ( int  dpi = -1) const

Save the figure to a QPixmap with specified DPI.

◆ saveFig() [3/3]

QPixmap QwtFigure::saveFig ( QSizeF &  inchesSize) const

Save the figure to a QPixmap with specified size in inches.

◆ sca()

void QwtFigure::sca ( QwtPlot plot)

Set the current axes (plot)

◆ setCurrentAxes()

void QwtFigure::setCurrentAxes ( QwtPlot plot)

Set the current axes (plot)

◆ setEdgeColor()

void QwtFigure::setEdgeColor ( const QColor &  color)

Set the edge color of the figure.

◆ setEdgeLineWidth()

void QwtFigure::setEdgeLineWidth ( int  width)

Set the edge line width of the figure.

◆ setFaceBrush()

void QwtFigure::setFaceBrush ( const QBrush &  brush)

Set the face brush of the figure.

◆ setFaceColor()

void QwtFigure::setFaceColor ( const QColor &  color)

Set the face color of the figure.

◆ setSizeInches() [1/2]

void QwtFigure::setSizeInches ( const QSizeF &  size)

Set the size of the figure in inches.

◆ setSizeInches() [2/2]

void QwtFigure::setSizeInches ( float  width,
float  height 
)

Set the size of the figure in inches.

◆ setWidgetNormPos()

void QwtFigure::setWidgetNormPos ( QWidget *  widget,
const QRectF &  rect 
)

改变已经添加的窗口的位置占比,如果窗口还没添加,此函数无效

Parameters
widget
rect

◆ takeAxes()

bool QwtFigure::takeAxes ( QwtPlot plot)

Take a specific axes (plot) from the figure without deleting it.

◆ widgetNormRect()

QRectF QwtFigure::widgetNormRect ( QWidget *  w) const

Get the normalized rectangle for a widget.


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