Class QAccelPlot::SelectionTool¶
ClassList > QAccelPlot > SelectionTool
Selects a data-space region by dragging, without changing the plot viewport. More...
#include <SelectionTool.hpp>
Inherits the following classes: QObject
Inheritance diagram¶
flowchart TB
classQAccelPlot_1_1SelectionTool["QAccelPlot::SelectionTool"]
external_base_classQAccelPlot_1_1SelectionTool_1["QObject"]
external_base_classQAccelPlot_1_1SelectionTool_1 --> classQAccelPlot_1_1SelectionTool
Public Types¶
| Type | Name |
|---|---|
| enum | Mode Region selected by a gesture. |
Public Properties¶
| Type | Name |
|---|---|
| property Border * | border Outline inside the rectangle's edges. Default: Colors.dark.selectionBorder , width 1. |
| property Qt::MouseButton | button Mouse button that starts a gesture. Default: Qt.LeftButton. |
| property bool | enabled Enables gestures; disabling cancels a gesture in progress and keeps the selection. Default: true. |
| property QColor | fillColor Fill color of the rectangle. Default: Colors.dark.selectionFill . |
| property bool | hasSelection True while a region is selected. |
| property qreal | minimumSize Smallest gesture in logical pixels that selects; a smaller one only clears the selection. Default: 6. |
| property Mode | mode Region a gesture selects: a box, an X range, or a Y range. Default: Box. |
| property InspectionRowModel * | model Read-only constant: one row of region statistics per selected series. |
| property Qt::KeyboardModifiers | modifiers Exact Qt::KeyboardModifiers required at press time. Default: Qt.ShiftModifier. |
| property PlotView * | plot Plot receiving the selection gestures. |
| property bool | selecting True while a gesture is in progress. |
| property QRectF | selectionRect Gesture or selected region in the plot's coordinates, in logical pixels; empty without either. |
| property bool | visible Draws the gesture and the selected region with fillColor andborder . Default: true. |
| property Axis * | xAxis Axis the X limits refer to; unset uses the plot's primary X axis. |
| property qreal | xMax Upper X limit of the selection; Infinity when unbounded, NaN without a selection. |
| property qreal | xMin Lower X limit of the selection; -Infinity when unbounded, NaN without a selection. |
| property Axis * | yAxis Axis the Y limits refer to; unset uses the plot's primary Y axis. |
| property qreal | yMax Upper Y limit of the selection; Infinity when unbounded, NaN without a selection. |
| property qreal | yMin Lower Y limit of the selection; -Infinity when unbounded, NaN without a selection. |
Public Signals¶
| Type | Name |
|---|---|
| signal void | buttonChanged Emitted when the button property changes. |
| signal void | completed Emitted when a gesture selected a region. Rows of series that are still preparing follow later. |
| signal void | enabledChanged Emitted when the enabled property changes. |
| signal void | fillColorChanged Emitted when the fillColor property changes. |
| signal void | minimumSizeChanged Emitted when the minimumSize property changes. |
| signal void | modeChanged Emitted when the mode property changes. |
| signal void | modifiersChanged Emitted when the modifiers property changes. |
| signal void | plotChanged Emitted when the plot property changes. |
| signal void | selectingChanged Emitted when a gesture starts or ends. |
| signal void | selectionChanged Emitted when the selected region is set, changed, or cleared. |
| signal void | selectionRectChanged Emitted when the selectionRect property changes. |
| signal void | visibleChanged Emitted when the visible property changes. |
| signal void | xAxisChanged Emitted when the axis the X limits refer to changes. |
| signal void | yAxisChanged Emitted when the axis the Y limits refer to changes. |
Public Functions¶
| Type | Name |
|---|---|
| SelectionTool (QObject * parent=nullptr) Constructs a tool without a plot. |
|
| Border * | border () const Returns the rectangle's outline settings. The object is owned by the tool. |
| Qt::MouseButton | button () const Returns the mouse button that starts a gesture. |
| Q_INVOKABLE void | clear () Cancels a gesture in progress and clears the selection. |
| bool | enabled () const Returns whether gestures are enabled. |
| QColor | fillColor () const Returns the rectangle's fill color. |
| bool | hasSelection () const Returns true while a region is selected. |
| Q_INVOKABLE InspectionPage | indices (PlotSeries * series, int offset=0, int limit=4096) Returns one page of series' source indices inside the selection, against its current data. |
| bool | isVisible () const Returns whether the tool draws the gesture and the selected region. |
| qreal | minimumSize () const Returns the smallest selecting gesture in logical pixels. |
| Mode | mode () const Returns the region a gesture selects. |
| InspectionRowModel * | model () const Returns the model of per-series region statistics. |
| Qt::KeyboardModifiers | modifiers () const Returns the required keyboard modifiers. |
| PlotView * | plot () const Returns the attached plot. |
| Q_INVOKABLE bool | select (qreal xMin, qreal xMax, qreal yMin, qreal yMax) Selects the region with the given limits; returns false when a limit is NaN. |
| bool | selecting () const Returns true while a gesture is in progress. |
| QRectF | selectionRect () const Returns the gesture or selected region in the plot's coordinates, in logical pixels. |
| void | setButton (Qt::MouseButton button) Sets the mouse button that starts a gesture. |
| void | setEnabled (bool enabled) Enables or disables gestures. |
| void | setFillColor (const QColor & color) Sets the rectangle's fill color. |
| void | setMinimumSize (qreal size) Sets the smallest selecting gesture, clamping negative values to zero and ignoring nonfinite values. |
| void | setMode (Mode mode) Sets the region a gesture selects and cancels a gesture in progress. |
| void | setModifiers (Qt::KeyboardModifiers modifiers) Sets the exact keyboard modifiers required at press time. |
| void | setPlot (PlotView * plot) Attaches to plot and clears the selection. |
| void | setVisible (bool visible) Shows or hides the tool's drawing without affecting gestures or the selection. |
| void | setXAxis (Axis * axis) Sets the X axis and clears the selection; null uses the plot's primary X axis. |
| void | setYAxis (Axis * axis) Sets the Y axis and clears the selection; null uses the plot's primary Y axis. |
| Axis * | xAxis () const Returns the axis the X limits refer to. |
| qreal | xMax () const Returns the upper X limit of the selection. |
| qreal | xMin () const Returns the lower X limit of the selection. |
| Axis * | yAxis () const Returns the axis the Y limits refer to. |
| qreal | yMax () const Returns the upper Y limit of the selection. |
| qreal | yMin () const Returns the lower Y limit of the selection. |
Detailed Description¶
The tool draws the gesture and the selected region in the plot's overlay, below the overlay's other children. To draw them yourself, set visible to false and bind an overlay item to selectionRect. The region is kept in data coordinates, so it follows panning and zooming and survives data updates: the model rows are recomputed whenever a series changes. An infinite limit leaves that side of the region unbounded, as a range selection does for its other dimension.
See also: SeriesInspection, InspectionRowModel
Public Types Documentation¶
enum Mode¶
Region selected by a gesture.
Public Properties Documentation¶
property border¶
Outline inside the rectangle's edges. Default: Colors.dark.selectionBorder , width 1.
property button¶
Mouse button that starts a gesture. Default: Qt.LeftButton.
property enabled¶
Enables gestures; disabling cancels a gesture in progress and keeps the selection. Default: true.
property fillColor¶
Fill color of the rectangle. Default: Colors.dark.selectionFill .
property hasSelection¶
True while a region is selected.
property minimumSize¶
Smallest gesture in logical pixels that selects; a smaller one only clears the selection. Default: 6.
property mode¶
Region a gesture selects: a box, an X range, or a Y range. Default: Box.
property model¶
Read-only constant: one row of region statistics per selected series.
property modifiers¶
Exact Qt::KeyboardModifiers required at press time. Default: Qt.ShiftModifier.
property plot¶
Plot receiving the selection gestures.
property selecting¶
True while a gesture is in progress.
property selectionRect¶
Gesture or selected region in the plot's coordinates, in logical pixels; empty without either.
This is the rectangle the tool draws. It follows panning and zooming, and an unbounded side lies on the plot-area edge. It extends past plotRect when the region is partly out of view; the tool clips its drawing to the plot area. The plot's overlay shares these coordinates, so an item there can bind to it directly.
property visible¶
Draws the gesture and the selected region with fillColor andborder . Default: true.
Gestures and the selection work either way. Set it to false to draw selectionRect with your own item.
property xAxis¶
Axis the X limits refer to; unset uses the plot's primary X axis.
property xMax¶
Upper X limit of the selection; Infinity when unbounded, NaN without a selection.
property xMin¶
Lower X limit of the selection; -Infinity when unbounded, NaN without a selection.
property yAxis¶
Axis the Y limits refer to; unset uses the plot's primary Y axis.
property yMax¶
Upper Y limit of the selection; Infinity when unbounded, NaN without a selection.
property yMin¶
Lower Y limit of the selection; -Infinity when unbounded, NaN without a selection.
Public Signals Documentation¶
signal buttonChanged¶
Emitted when the button property changes.
signal completed¶
Emitted when a gesture selected a region. Rows of series that are still preparing follow later.
signal enabledChanged¶
Emitted when the enabled property changes.
signal fillColorChanged¶
Emitted when the fillColor property changes.
signal minimumSizeChanged¶
Emitted when the minimumSize property changes.
signal modeChanged¶
Emitted when the mode property changes.
signal modifiersChanged¶
Emitted when the modifiers property changes.
signal plotChanged¶
Emitted when the plot property changes.
signal selectingChanged¶
Emitted when a gesture starts or ends.
signal selectionChanged¶
Emitted when the selected region is set, changed, or cleared.
signal selectionRectChanged¶
Emitted when the selectionRect property changes.
signal visibleChanged¶
Emitted when the visible property changes.
signal xAxisChanged¶
Emitted when the axis the X limits refer to changes.
signal yAxisChanged¶
Emitted when the axis the Y limits refer to changes.
Public Functions Documentation¶
function SelectionTool¶
Constructs a tool without a plot.
function border¶
Returns the rectangle's outline settings. The object is owned by the tool.
function button¶
Returns the mouse button that starts a gesture.
function clear¶
Cancels a gesture in progress and clears the selection.
function enabled¶
Returns whether gestures are enabled.
function fillColor¶
Returns the rectangle's fill color.
function hasSelection¶
Returns true while a region is selected.
function indices¶
Returns one page of series' source indices inside the selection, against its current data.
Q_INVOKABLE InspectionPage QAccelPlot::SelectionTool::indices (
PlotSeries * series,
int offset=0,
int limit=4096
)
Pages like SeriesInspection::indices(): limit must be positive and is capped at 4096.
function isVisible¶
Returns whether the tool draws the gesture and the selected region.
function minimumSize¶
Returns the smallest selecting gesture in logical pixels.
function mode¶
Returns the region a gesture selects.
function model¶
Returns the model of per-series region statistics.
function modifiers¶
Returns the required keyboard modifiers.
function plot¶
Returns the attached plot.
function select¶
Selects the region with the given limits; returns false when a limit is NaN.
Q_INVOKABLE bool QAccelPlot::SelectionTool::select (
qreal xMin,
qreal xMax,
qreal yMin,
qreal yMax
)
function selecting¶
Returns true while a gesture is in progress.
function selectionRect¶
Returns the gesture or selected region in the plot's coordinates, in logical pixels.
function setButton¶
Sets the mouse button that starts a gesture.
function setEnabled¶
Enables or disables gestures.
function setFillColor¶
Sets the rectangle's fill color.
function setMinimumSize¶
Sets the smallest selecting gesture, clamping negative values to zero and ignoring nonfinite values.
function setMode¶
Sets the region a gesture selects and cancels a gesture in progress.
function setModifiers¶
Sets the exact keyboard modifiers required at press time.
function setPlot¶
Attaches to plot and clears the selection.
function setVisible¶
Shows or hides the tool's drawing without affecting gestures or the selection.
function setXAxis¶
Sets the X axis and clears the selection; null uses the plot's primary X axis.
function setYAxis¶
Sets the Y axis and clears the selection; null uses the plot's primary Y axis.
function xAxis¶
Returns the axis the X limits refer to.
function xMax¶
Returns the upper X limit of the selection.
function xMin¶
Returns the lower X limit of the selection.
function yAxis¶
Returns the axis the Y limits refer to.
function yMax¶
Returns the upper Y limit of the selection.
function yMin¶
Returns the lower Y limit of the selection.
The documentation for this class was generated from the following file QAccelPlot/src/QAccelPlot/inspection/SelectionTool.hpp