|
QWT API (English) 7.0.1
Qt Widget Library for Technical Applications - English API Documentation
|
A figure container for organizing Qwt plots with flexible layout options. More...
#include <qwt_figure.h>
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. | |
| QwtPlot * | createParasiteAxes (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) | |
| QwtPlot * | currentAxes () const |
| Get the current axes (plot) | |
| QwtPlot * | gca () 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. | |
| QwtPlot * | plotUnderPos (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 |
A figure container for organizing Qwt plots with flexible layout options.
| QwtFigure::QwtFigure | ( | QWidget * | parent = nullptr, |
| Qt::WindowFlags | f = Qt::WindowFlags() |
||
| ) |
Constructor.
| void QwtFigure::addAxes | ( | QwtPlot * | plot, |
| const QRectF & | rect | ||
| ) |
Add a plot with normalized coordinates.
| void QwtFigure::addAxes | ( | QwtPlot * | plot, |
| qreal | left, | ||
| qreal | top, | ||
| qreal | width, | ||
| qreal | height | ||
| ) |
Add a plot with normalized coordinates using separate parameters.
Add axis alignment configuration.
| 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.
| 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.
| void QwtFigure::addWidget | ( | QWidget * | widget, |
| qreal | left, | ||
| qreal | top, | ||
| qreal | width, | ||
| qreal | height | ||
| ) |
Add a widget with normalized coordinates.
Align axes of multiple plots.
Get all axes (plots) in the figure (not including parasite axes)
| void QwtFigure::applyAlignmentsForAxis | ( | int | axisId | ) |
Apply alignment configurations for a specific axis.
| void QwtFigure::applyAllAxisAlignments | ( | bool | replot = true | ) |
Apply all axis alignment configurations.
|
signal |
Signal emitted when axes are added to the figure.
| QRectF QwtFigure::axesNormRect | ( | QwtPlot * | plot | ) | const |
Get the normalized rectangle for a axes.
|
signal |
Signal emitted when axes are removed from the figure.
| int QwtFigure::axisAligmentCount | ( | ) | const |
Get the number of axis alignment configurations.
Get axis alignment information by index.
| QRect QwtFigure::calcActualRect | ( | const QRectF & | normRect | ) |
Calculate actual rectangle from normalized coordinates.
| QRectF QwtFigure::calcNormRect | ( | const QRect & | geoRect | ) | const |
Calculate normalized coordinates from actual window coordinates.
| void QwtFigure::clear | ( | ) |
Clear all axes from the figure.
| void QwtFigure::clearAxisAlignment | ( | ) |
Clear all axis alignment configurations.
| QwtPlot * QwtFigure::createParasiteAxes | ( | QwtPlot * | hostPlot, |
| QwtAxis::Position | enableAxis | ||
| ) |
Create parasite axes for a host plot.
| QwtPlot * QwtFigure::currentAxes | ( | ) | const |
Get the current axes (plot)
|
signal |
Signal emitted when the current active axes changes.
| QColor QwtFigure::edgeColor | ( | ) | const |
Get the edge color of the figure.
| int QwtFigure::edgeLineWidth | ( | ) | const |
Get the edge line width of the figure.
| QBrush QwtFigure::faceBrush | ( | ) | const |
Get the face brush of the figure.
| QColor QwtFigure::faceColor | ( | ) | const |
Get the face color of the figure.
|
signal |
Signal emitted when the figure is cleared .
| QwtPlot * QwtFigure::gca | ( | ) | const |
Get the current axes (plot)
Get all parasite axes for a host plot.
| QSize QwtFigure::getSizeInches | ( | ) | const |
Get the size of the figure in inches.
| bool QwtFigure::hasAxes | ( | ) | const |
Check if the figure has any axes.
| bool QwtFigure::hasAxes | ( | QwtPlot * | plot | ) | const |
Check if the figure contains a specific plot.
| QwtPlot * QwtFigure::plotUnderPos | ( | const QPoint & | pos | ) | const |
Get the plot under a position.
| void QwtFigure::removeAxes | ( | QwtPlot * | plot | ) |
Remove a specific axes (plot) from the figure.
Remove specified axis alignment configuration.
| void QwtFigure::replotAll | ( | ) |
Update all plots in the figure.
| bool QwtFigure::saveFig | ( | const QString & | filename, |
| int | dpi = -1 |
||
| ) | const |
Save the figure to a file with specified DPI.
| QPixmap QwtFigure::saveFig | ( | int | dpi = -1 | ) | const |
Save the figure to a QPixmap with specified DPI.
| QPixmap QwtFigure::saveFig | ( | QSizeF & | inchesSize | ) | const |
Save the figure to a QPixmap with specified size in inches.
| void QwtFigure::sca | ( | QwtPlot * | plot | ) |
Set the current axes (plot)
| void QwtFigure::setCurrentAxes | ( | QwtPlot * | plot | ) |
Set the current axes (plot)
| void QwtFigure::setEdgeColor | ( | const QColor & | color | ) |
Set the edge color of the figure.
| void QwtFigure::setEdgeLineWidth | ( | int | width | ) |
Set the edge line width of the figure.
| void QwtFigure::setFaceBrush | ( | const QBrush & | brush | ) |
Set the face brush of the figure.
| void QwtFigure::setFaceColor | ( | const QColor & | color | ) |
Set the face color of the figure.
| void QwtFigure::setSizeInches | ( | const QSizeF & | size | ) |
Set the size of the figure in inches.
| void QwtFigure::setSizeInches | ( | float | width, |
| float | height | ||
| ) |
Set the size of the figure in inches.
| void QwtFigure::setWidgetNormPos | ( | QWidget * | widget, |
| const QRectF & | rect | ||
| ) |
改变已经添加的窗口的位置占比,如果窗口还没添加,此函数无效
| widget | |
| rect |
| bool QwtFigure::takeAxes | ( | QwtPlot * | plot | ) |
Take a specific axes (plot) from the figure without deleting it.
| QRectF QwtFigure::widgetNormRect | ( | QWidget * | w | ) | const |
Get the normalized rectangle for a widget.