Class QAccelPlot::PlotInspector¶
ClassList > QAccelPlot > PlotInspector
Inspects the visible XY series and heatmaps of a plot at a cursor and publishes one model row per series. More...
#include <PlotInspector.hpp>
Inherits the following classes: QObject
Inheritance diagram¶
flowchart TB
classQAccelPlot_1_1PlotInspector["QAccelPlot::PlotInspector"]
external_base_classQAccelPlot_1_1PlotInspector_1["QObject"]
external_base_classQAccelPlot_1_1PlotInspector_1 --> classQAccelPlot_1_1PlotInspector
Public Types¶
| Type | Name |
|---|---|
| enum | Mode How each series is matched to the cursor. |
Public Properties¶
| Type | Name |
|---|---|
| property bool | active True while enabled and the cursor is inside the plot area. |
| property QPointF | crosshairPosition Crosshair position in plot-local logical pixels: the cursor's, or the matched data point's with snapToDataPoint . A coordinate the cursor lacks is NaN. |
| property qreal | cursorPixelX Cursor X in plot-local logical pixels, the pixel of cursorX ; NaN when the cursor has no X. |
| property qreal | cursorPixelY Cursor Y in plot-local logical pixels, the pixel of cursorY ; seecursorPixelX . |
| property qreal | cursorX Cursor X on the plot's primary X axis: the pointer's while followPointer is true, NaN when it is outside. |
| property QString | cursorXText Crosshair X formatted by the plot's primary X axis. |
| property qreal | cursorY Cursor Y on the plot's primary Y axis; see cursorX . NaN leaves the cursor without a Y. |
| property QString | cursorYText Crosshair Y formatted by the plot's primary Y axis; empty without a cursor Y. |
| property QQmlListProperty< QObject > | data Default property: objects declared inside the inspector. |
| property bool | enabled Enables queries. A disabled inspector is inactive and does no work. Default: true. |
| property QList< PlotSeries * > | excludedSeries Series never inspected, even when listed in includedSeries . |
| property bool | followPointer Whether the cursor follows the plot's pointer. When false it stays at cursorX andcursorY . Default: true. |
| property QList< PlotSeries * > | includedSeries Series to inspect; an empty list inspects every series of the plot. |
| property bool | interpolate In NearestX andNearestY mode, reports the point on the line between two consecutive data points instead of the nearer one. Default: false. |
| property Mode | mode NearestX andNearestY report each series at the cursor's X or Y;NearestXY picks by on-screen distance. Default: NearestX. |
| property InspectionRowModel * | model Read-only constant: one row per inspected series. |
| property PlotView * | plot Plot whose series are inspected. |
| property qreal | radius Pick distance in logical pixels. In NearestX andNearestY mode it only limits matches beyond a series' extreme data points. Default: 16. |
| property bool | snapToDataPoint Moves the crosshair to the closest matching data point. Default: false. |
| property bool | summaries Adds Y statistics of the data points around the cursor to every row. Default: false. |
| property qreal | summaryRadius Half-width of the summary neighborhood in logical pixels. Default: 0.5. |
| property int | validCount Number of rows with a matching data point. |
Public Signals¶
| Type | Name |
|---|---|
| signal void | activeChanged Emitted when the active property changes. |
| signal void | crosshairPositionChanged Emitted when the crosshairPosition property changes. |
| signal void | cursorChanged Emitted when the cursor coordinates or their texts change. |
| signal void | enabledChanged Emitted when the enabled property changes. |
| signal void | excludedSeriesChanged Emitted when the excludedSeries property changes. |
| signal void | followPointerChanged Emitted when the followPointer property changes. |
| signal void | includedSeriesChanged Emitted when the includedSeries property changes. |
| signal void | interpolateChanged Emitted when the interpolate property changes. |
| signal void | modeChanged Emitted when the mode property changes. |
| signal void | plotChanged Emitted when the plot property changes. |
| signal void | radiusChanged Emitted when the radius property changes. |
| signal void | refreshed Emitted after every refresh that published results. |
| signal void | snapToDataPointChanged Emitted when the snapToDataPoint property changes. |
| signal void | summariesChanged Emitted when the summaries property changes. |
| signal void | summaryRadiusChanged Emitted when the summaryRadius property changes. |
| signal void | validCountChanged Emitted when the validCount property changes. |
Public Functions¶
| Type | Name |
|---|---|
| PlotInspector (QObject * parent=nullptr) Constructs an inspector without a plot. |
|
| bool | active () const Returns whether the cursor is inside the plot area. |
| QPointF | crosshairPosition () const Returns the crosshair position in plot-local logical pixels. |
| qreal | cursorPixelX () const Returns the cursor X in plot-local logical pixels. |
| qreal | cursorPixelY () const Returns the cursor Y in plot-local logical pixels. |
| qreal | cursorX () const Returns the cursor X on the plot's primary X axis. |
| QString | cursorXText () const Returns the formatted crosshair X. |
| qreal | cursorY () const Returns the cursor Y on the plot's primary Y axis. |
| QString | cursorYText () const Returns the formatted crosshair Y. |
| QQmlListProperty< QObject > | data () Returns the objects declared inside the inspector. |
| bool | enabled () const Returns whether queries are enabled. |
| QList< PlotSeries * > | excludedSeries () const Returns the series never inspected, without destroyed entries. |
| bool | followPointer () const Returns whether the cursor follows the plot's pointer. |
| QList< PlotSeries * > | includedSeries () const Returns the series to inspect, without destroyed entries. |
| bool | interpolate () const Returns whether NearestX andNearestY rows are interpolated between data points. |
| Mode | mode () const Returns the matching mode. |
| InspectionRowModel * | model () const Returns the row model. |
| PlotView * | plot () const Returns the inspected plot. |
| qreal | radius () const Returns the pick distance in logical pixels. |
| Q_INVOKABLE void | refresh () Runs the queries now instead of on the next event-loop pass. |
| void | setCursorPixelX (qreal x) Sets the cursor X in plot-local logical pixels used while followPointer is false. |
| void | setCursorPixelY (qreal y) Sets the cursor Y in plot-local logical pixels used while followPointer is false. |
| void | setCursorX (qreal x) Sets the cursor X used while followPointer is false. |
| void | setCursorY (qreal y) Sets the cursor Y used while followPointer is false. |
| void | setEnabled (bool enabled) Enables or disables queries. |
| void | setExcludedSeries (const QList< PlotSeries * > & series) Sets the series never inspected. |
| void | setFollowPointer (bool follow) Switches between following the pointer and a cursor set from code. |
| void | setIncludedSeries (const QList< PlotSeries * > & series) Sets the series to inspect. |
| void | setInterpolate (bool enabled) Enables or disables interpolation between consecutive data points. |
| void | setMode (Mode mode) Sets the matching mode. |
| void | setPlot (PlotView * plot) Sets the inspected plot. |
| void | setRadius (qreal radius) Sets the pick distance; negative and NaN values are ignored. |
| void | setSnapToDataPoint (bool enabled) Enables or disables crosshair snapping. |
| void | setSummaries (bool enabled) Enables or disables neighborhood statistics. |
| void | setSummaryRadius (qreal radius) Sets the summary half-width; negative and nonfinite values are ignored. |
| bool | snapToDataPoint () const Returns whether the crosshair snaps to the closest matching data point. |
| Q_INVOKABLE void | stepCursor (int steps) Moves the cursor steps source records along the first matching XY series and stops following the pointer. |
| bool | summaries () const Returns whether rows include neighborhood statistics. |
| qreal | summaryRadius () const Returns the summary half-width in logical pixels. |
| int | validCount () const Returns the number of rows with a matching data point. |
| ~PlotInspector () override Destroys the inspector and the objects declared inside it. |
Detailed Description¶
Series that draw data points as areas, such as HeatmapSeries, report the record under the cursor in every mode, and only while the cursor has both coordinates; radius, interpolate, and summaries do not apply to them, and snapToDataPoint moves both crosshair coordinates to the record's center.
The cursor follows the plot's pointer by default; set followPointer to false and write cursorX to drive it from code, for example to link the crosshairs of several plots, or cursorPixelX to keep it at a pixel while the axes pan or zoom. Results are refreshed at most once per event-loop pass.
In QML, declare Crosshair, InspectionMarkers, and InspectionTooltip inside the inspector: they receive it as their inspector and are stacked in declaration order, the last one on top.
See also: SeriesInspection, InspectionRowModel
Public Types Documentation¶
enum Mode¶
How each series is matched to the cursor.
Public Properties Documentation¶
property active¶
True while enabled and the cursor is inside the plot area.
property crosshairPosition¶
Crosshair position in plot-local logical pixels: the cursor's, or the matched data point's with snapToDataPoint . A coordinate the cursor lacks is NaN.
property cursorPixelX¶
Cursor X in plot-local logical pixels, the pixel of cursorX ; NaN when the cursor has no X.
A written value is used while followPointer is false. It stays at the same pixel when the axes pan or zoom, and cursorX reports the data under it. Writing cursorX places the cursor in data units again.
property cursorPixelY¶
Cursor Y in plot-local logical pixels, the pixel of cursorY ; seecursorPixelX .
property cursorX¶
Cursor X on the plot's primary X axis: the pointer's while followPointer is true, NaN when it is outside.
A written value is used while followPointer is false.
property cursorXText¶
Crosshair X formatted by the plot's primary X axis.
property cursorY¶
Cursor Y on the plot's primary Y axis; see cursorX . NaN leaves the cursor without a Y.
property cursorYText¶
Crosshair Y formatted by the plot's primary Y axis; empty without a cursor Y.
property data¶
Default property: objects declared inside the inspector.
Every object with an inspector property receives this inspector. Items among them are stacked in declaration order above the other children of the plot's overlay.
property enabled¶
Enables queries. A disabled inspector is inactive and does no work. Default: true.
property excludedSeries¶
Series never inspected, even when listed in includedSeries .
property followPointer¶
Whether the cursor follows the plot's pointer. When false it stays at cursorX andcursorY . Default: true.
property includedSeries¶
Series to inspect; an empty list inspects every series of the plot.
property interpolate¶
In NearestX andNearestY mode, reports the point on the line between two consecutive data points instead of the nearer one. Default: false.
property mode¶
NearestX andNearestY report each series at the cursor's X or Y;NearestXY picks by on-screen distance. Default: NearestX.
property model¶
Read-only constant: one row per inspected series.
property plot¶
Plot whose series are inspected.
property radius¶
Pick distance in logical pixels. In NearestX andNearestY mode it only limits matches beyond a series' extreme data points. Default: 16.
property snapToDataPoint¶
Moves the crosshair to the closest matching data point. Default: false.
property summaries¶
Adds Y statistics of the data points around the cursor to every row. Default: false.
property summaryRadius¶
Half-width of the summary neighborhood in logical pixels. Default: 0.5.
property validCount¶
Number of rows with a matching data point.
Public Signals Documentation¶
signal activeChanged¶
Emitted when the active property changes.
signal crosshairPositionChanged¶
Emitted when the crosshairPosition property changes.
signal cursorChanged¶
Emitted when the cursor coordinates or their texts change.
signal enabledChanged¶
Emitted when the enabled property changes.
signal excludedSeriesChanged¶
Emitted when the excludedSeries property changes.
signal followPointerChanged¶
Emitted when the followPointer property changes.
signal includedSeriesChanged¶
Emitted when the includedSeries property changes.
signal interpolateChanged¶
Emitted when the interpolate property changes.
signal modeChanged¶
Emitted when the mode property changes.
signal plotChanged¶
Emitted when the plot property changes.
signal radiusChanged¶
Emitted when the radius property changes.
signal refreshed¶
Emitted after every refresh that published results.
signal snapToDataPointChanged¶
Emitted when the snapToDataPoint property changes.
signal summariesChanged¶
Emitted when the summaries property changes.
signal summaryRadiusChanged¶
Emitted when the summaryRadius property changes.
signal validCountChanged¶
Emitted when the validCount property changes.
Public Functions Documentation¶
function PlotInspector¶
Constructs an inspector without a plot.
function active¶
Returns whether the cursor is inside the plot area.
function crosshairPosition¶
Returns the crosshair position in plot-local logical pixels.
function cursorPixelX¶
Returns the cursor X in plot-local logical pixels.
function cursorPixelY¶
Returns the cursor Y in plot-local logical pixels.
function cursorX¶
Returns the cursor X on the plot's primary X axis.
function cursorXText¶
Returns the formatted crosshair X.
function cursorY¶
Returns the cursor Y on the plot's primary Y axis.
function cursorYText¶
Returns the formatted crosshair Y.
function data¶
Returns the objects declared inside the inspector.
function enabled¶
Returns whether queries are enabled.
function excludedSeries¶
Returns the series never inspected, without destroyed entries.
function followPointer¶
Returns whether the cursor follows the plot's pointer.
function includedSeries¶
Returns the series to inspect, without destroyed entries.
function interpolate¶
Returns whether NearestX andNearestY rows are interpolated between data points.
function mode¶
Returns the matching mode.
function model¶
Returns the row model.
function plot¶
Returns the inspected plot.
function radius¶
Returns the pick distance in logical pixels.
function refresh¶
Runs the queries now instead of on the next event-loop pass.
function setCursorPixelX¶
Sets the cursor X in plot-local logical pixels used while followPointer is false.
function setCursorPixelY¶
Sets the cursor Y in plot-local logical pixels used while followPointer is false.
function setCursorX¶
Sets the cursor X used while followPointer is false.
function setCursorY¶
Sets the cursor Y used while followPointer is false.
function setEnabled¶
Enables or disables queries.
function setExcludedSeries¶
Sets the series never inspected.
function setFollowPointer¶
Switches between following the pointer and a cursor set from code.
function setIncludedSeries¶
Sets the series to inspect.
function setInterpolate¶
Enables or disables interpolation between consecutive data points.
function setMode¶
Sets the matching mode.
function setPlot¶
Sets the inspected plot.
function setRadius¶
Sets the pick distance; negative and NaN values are ignored.
function setSnapToDataPoint¶
Enables or disables crosshair snapping.
function setSummaries¶
Enables or disables neighborhood statistics.
function setSummaryRadius¶
Sets the summary half-width; negative and nonfinite values are ignored.
function snapToDataPoint¶
Returns whether the crosshair snaps to the closest matching data point.
function stepCursor¶
Moves the cursor steps source records along the first matching XY series and stops following the pointer.
function summaries¶
Returns whether rows include neighborhood statistics.
function summaryRadius¶
Returns the summary half-width in logical pixels.
function validCount¶
Returns the number of rows with a matching data point.
function ~PlotInspector¶
Destroys the inspector and the objects declared inside it.
The documentation for this class was generated from the following file QAccelPlot/src/QAccelPlot/inspection/PlotInspector.hpp