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

Utility class for querying QwtPlotItem types and filtering plot items. More...

#include <qwt_plot_item_info.h>

Static Public Member Functions

static bool isSeriesItem (const QwtPlotItem *item)
 Check whether the item is a QwtPlotSeriesItem subclass.
 
static bool isXYSeriesItem (const QwtPlotItem *item)
 Check whether the item stores QPointF data.
 
static bool isIntervalSeriesItem (const QwtPlotItem *item)
 Check whether the item stores QwtIntervalSample data.
 
static bool isDecoratorItem (const QwtPlotItem *item)
 Check whether the item is a decorator (non-data item)
 
static bool isDataItem (const QwtPlotItem *item)
 Check whether the item holds any data series.
 
static QwtPlotItemList seriesItems (const QwtPlot *plot)
 Get all QwtPlotSeriesItem instances from a plot.
 
static QwtPlotItemList xySeriesItems (const QwtPlot *plot)
 Get all QPointF-based series items from a plot.
 
static QwtPlotItemList filterByRtti (const QwtPlot *plot, int rtti)
 Filter items by a single rtti value.
 
static QwtPlotItemList filterByRtti (const QwtPlot *plot, const QSet< int > &rttiSet)
 Filter items by a set of rtti values.
 
static QwtPlotItemList visibleItems (const QwtPlot *plot)
 Get all currently visible items from a plot.
 
static int dataSize (const QwtPlotItem *item)
 Get the number of data samples in a plot item.
 
static QRectF dataRect (const QwtPlotItem *item)
 Get the bounding rectangle of the item's data.
 
static QString rttiName (int rtti)
 Get a human-readable name for an rtti value.
 

Detailed Description

Utility class for querying QwtPlotItem types and filtering plot items.

QwtPlotItemInfo provides static methods to determine the runtime type of plot items, filter items by category, and retrieve basic information such as data size and bounding rectangle. This class does not modify any plot or item state.

QwtPlot* plot = ...;
QwtPlotItemList curves = Qwt::QwtPlotItemInfo::xySeriesItems(plot);
for (auto* item : curves) {
qDebug() << item->title().text()
<< "has" << Qwt::QwtPlotItemInfo::dataSize(item) << "points";
}
A 2-D plotting widget.
Definition qwt_plot.h:99
See also
QwtPlotDataAccess, QwtPlotStyling

Member Function Documentation

◆ dataRect()

QRectF QwtPlotItemInfo::dataRect ( const QwtPlotItem item)
static

Get the bounding rectangle of the item's data.

Parameters
itemPlot item to query
Returns
Bounding rectangle, or an invalid QRectF if the item does not hold data

◆ dataSize()

int QwtPlotItemInfo::dataSize ( const QwtPlotItem item)
static

Get the number of data samples in a plot item.

Parameters
itemPlot item to query
Returns
Number of samples, or -1 if the item does not hold a data series

◆ filterByRtti() [1/2]

QwtPlotItemList QwtPlotItemInfo::filterByRtti ( const QwtPlot plot,
const QSet< int > &  rttiSet 
)
static

Filter items by a set of rtti values.

Parameters
plotPlot to query
rttiSetSet of rtti values to match
Returns
List of items whose rtti is in the set

◆ filterByRtti() [2/2]

QwtPlotItemList QwtPlotItemInfo::filterByRtti ( const QwtPlot plot,
int  rtti 
)
static

Filter items by a single rtti value.

Parameters
plotPlot to query
rttiRuntime type value to match
Returns
List of items matching the rtti
See also
QwtPlotDict::itemList(int)

◆ isDataItem()

bool QwtPlotItemInfo::isDataItem ( const QwtPlotItem item)
static

Check whether the item holds any data series.

Parameters
itemPlot item to check
Returns
true for all QwtPlotSeriesItem subclasses
See also
isSeriesItem()

◆ isDecoratorItem()

bool QwtPlotItemInfo::isDecoratorItem ( const QwtPlotItem item)
static

Check whether the item is a decorator (non-data item)

Parameters
itemPlot item to check
Returns
true for grid, marker, scale, legend, text label, zone, shape, graphic, arrow marker

◆ isIntervalSeriesItem()

bool QwtPlotItemInfo::isIntervalSeriesItem ( const QwtPlotItem item)
static

Check whether the item stores QwtIntervalSample data.

Parameters
itemPlot item to check
Returns
true for QwtPlotIntervalCurve and QwtPlotHistogram

◆ isSeriesItem()

bool QwtPlotItemInfo::isSeriesItem ( const QwtPlotItem item)
static

Check whether the item is a QwtPlotSeriesItem subclass.

Parameters
itemPlot item to check, may be nullptr
Returns
true if item is derived from QwtPlotSeriesItem

◆ isXYSeriesItem()

bool QwtPlotItemInfo::isXYSeriesItem ( const QwtPlotItem item)
static

Check whether the item stores QPointF data.

Parameters
itemPlot item to check
Returns
true for QwtPlotCurve and QwtPlotBarChart

◆ rttiName()

QString QwtPlotItemInfo::rttiName ( int  rtti)
static

Get a human-readable name for an rtti value.

Parameters
rttiRuntime type value
Returns
String name such as "PlotCurve", "PlotBarChart", etc.

◆ seriesItems()

QwtPlotItemList QwtPlotItemInfo::seriesItems ( const QwtPlot plot)
static

Get all QwtPlotSeriesItem instances from a plot.

Parameters
plotPlot to query
Returns
List of series items

◆ visibleItems()

QwtPlotItemList QwtPlotItemInfo::visibleItems ( const QwtPlot plot)
static

Get all currently visible items from a plot.

Parameters
plotPlot to query
Returns
List of visible items

◆ xySeriesItems()

QwtPlotItemList QwtPlotItemInfo::xySeriesItems ( const QwtPlot plot)
static

Get all QPointF-based series items from a plot.

Parameters
plotPlot to query
Returns
List of XY series items (curves and bar charts)

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