QBoxSet Class | Qt Charts 5.7

Qt 5.7 | Qt Charts | C++ Classes | QBoxSet

Qt 5.7.1 Reference Documentation

# QBoxSet Class

Building block for box-and-whiskers chart. More...

Header: | #include <QBoxSet>
Instantiated By: | BoxSet
Inherits: | QObject

- List of all members, including inherited members

## Public Types

enum | ValuePositions { LowerExtreme, LowerQuartile, Median, UpperQuartile, UpperExtreme }

## Properties

- brush : QBrush
- pen : QPen

- 1 property inherited from QObject

## Public Functions

| QBoxSet(const QString label = QString(), QObject *parent = Q_NULLPTR)
| QBoxSet(const qreal le, const qreal lq, const qreal m, const qreal uq, const qreal ue, const QString label = QString(), QObject *parent = Q_NULLPTR)
virtual | ~QBoxSet()
void | append(const qreal value)
void | append(const QList<qreal> &values)
qreal | at(const int index) const
QBrush | brush() const
void | clear()
int | count() const
QString | label() const
QPen | pen() const
void | setBrush(const QBrush &brush)
void | setLabel(const QString label)
void | setPen(const QPen &pen)
void | setValue(const int index, const qreal value)
QBoxSet & | operator<<(const qreal &value)
qreal | operator[](const int index) const

- 31 public functions inherited from QObject

## Signals

void | brushChanged()
void | cleared()
void | clicked()
void | doubleClicked()
void | hovered(bool status)
void | penChanged()
void | pressed()
void | released()
void | valueChanged(int index)
void | valuesChanged()

- 2 signals inherited from QObject

### Additional Inherited Members

- 1 public slot inherited from QObject
- 1 public variable inherited from QObject
- 10 static public members inherited from QObject
- 9 protected functions inherited from QObject
- 2 protected variables inherited from QObject

## Detailed Description

Building block for box-and-whiskers chart.

QBoxSet represents one box-and-whiskers item. It takes five values to create a graphical representation of range and three medians. There are two ways to give the values. The first one is with constructor or stream operator (<<). The values have to be given in the following order: lower extreme, lower quartile, median, upper quartile and upper extreme. The Second method is to create an empty QBoxSet instance and give the values using setValue method.

See also QBoxPlotSeries.

## Member Type Documentation

### enum QBoxSet::ValuePositions

Constant | Value
--- | ---
`QBoxSet::LowerExtreme` | `0`
`QBoxSet::LowerQuartile` | `1`
`QBoxSet::Median` | `2`
`QBoxSet::UpperQuartile` | `3`
`QBoxSet::UpperExtreme` | `4`

## Property Documentation

### brush : QBrush

This property defines the brush used by the box-and-whiskers set.

Access functions:

QBrush | brush() const
void | setBrush(const QBrush &brush)

Notifier signal:

void | brushChanged()

### pen : QPen

This property defines the pen used by the box-and-whiskers set.

Access functions:

QPen | pen() const
void | setPen(const QPen &pen)

Notifier signal:

void | penChanged()

## Member Function Documentation

### QBoxSet::QBoxSet(const QString label = QString(), QObject *parent = Q_NULLPTR)

Constructs QBoxSet with optional label and parent of parent

### QBoxSet::QBoxSet(const qreal le, const qreal lq, const qreal m, const qreal uq, const qreal ue, const QString label = QString(), QObject *parent = Q_NULLPTR)

Constructs QBoxSet with given ordered values. le for lower extreme, lq for lower quartile, m for median, uq for upper quartile and ue for upper quartile. label and parent are optional.

### `[virtual]` QBoxSet::~QBoxSet()

Destroys the boxset

### void QBoxSet::append(const qreal value)

Appends new value value to the end of set.

### void QBoxSet::append(const QList<qreal> &values)

Appends a list of reals to set. Works like append with single real value. The values in list are appended to end of boxset.

See also append().

### qreal QBoxSet::at(const int index) const

Returns value of set indexed by index. For index ValuePositions can be used. If the index is out of bounds 0.0 is returned.

### QBrush QBoxSet::brush() const

Returns brush of the set.

Note: Getter function for property brush.

See also setBrush().

### `[signal]` void QBoxSet::brushChanged()

This signal is emitted when the brush of the box-and-whisker item has changed.

Note: Notifier signal for property brush.

See also brush.

### void QBoxSet::clear()

Sets all values on the set to 0.

### `[signal]` void QBoxSet::cleared()

This signal is emitted when all the values on the set are cleared to 0.

### `[signal]` void QBoxSet::clicked()

The signal is emitted if the user clicks with a mouse on top of box-and-whisker item.

### int QBoxSet::count() const

Returns count of values appended to the set.

### `[signal]` void QBoxSet::doubleClicked()

The signal is emitted if the user doubleclicks with a mouse on top of box-and-whisker item.

### `[signal]` void QBoxSet::hovered(bool status)

The signal is emitted if mouse is hovered on top of box-and-whisker item. Parameter status is true, if mouse entered on top of item, false if mouse left from top of item.

### QString QBoxSet::label() const

Returns the label of the the category of the set.

See also setLabel().

### QPen QBoxSet::pen() const

Returns pen of the set.

Note: Getter function for property pen.

See also setPen().

### `[signal]` void QBoxSet::penChanged()

This signal is emitted when the pen of the box-and-whisker item has changed.

Note: Notifier signal for property pen.

See also pen.

### `[signal]` void QBoxSet::pressed()

The signal is emitted if the user presses with a mouse on top of box-and-whisker item.

### `[signal]` void QBoxSet::released()

The signal is emitted if the user releases with a mouse on top of box-and-whisker item.

### void QBoxSet::setBrush(const QBrush &brush)

Sets brush for the set. Boxes of this set are drawn using brush

Note: Setter function for property brush.

See also brush().

### void QBoxSet::setLabel(const QString label)

Sets new label for the category of the set.

See also label().

### void QBoxSet::setPen(const QPen &pen)

Sets pen for set. Boxes of this set are drawn using pen

Note: Setter function for property pen.

See also pen().

### void QBoxSet::setValue(const int index, const qreal value)

Sets a new value on the index position. For index ValuePositions can be used.

### `[signal]` void QBoxSet::valueChanged(int index)

This signal is emitted values the value in the box-and-whisker item has been modified. Parameter index indicates the position of the modified value.

See also at().

### `[signal]` void QBoxSet::valuesChanged()

This signal is emitted when multiple values have been changed on the box-and-whisker item.

See also append().

### QBoxSet &QBoxSet::operator<<(const qreal &value)

Convenience operator. Same as append, with real value.

See also append().

### qreal QBoxSet::operator[](const int index) const

Returns value of set indexed by index. For index ValuePositions can be used. If the index is out of bounds 0.0 is returned.