QBoxSet Class

The QBoxSet class represents one item in a box-and-whiskers chart. 更多...

头: #include <QBoxSet>
实例化: BoxSet
继承: QObject

公共类型

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

特性

公共函数

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> & )
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

信号

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

额外继承成员

详细描述

The QBoxSet class represents one item in a box-and-whiskers chart.

A box-and-whiskers item is a graphical representation of a range and three median values that is constructed from five different values. There are two ways to specify the values. The first one is by using a constructor or stream operator (<<). The values have to be specified in the following order: lower extreme, lower quartile, median, upper quartile, and upper extreme.

The second way is to create an empty QBoxSet instance and specify the values using the setValue () 方法。

box-and-whiskers chart example to learn how to create a box-and-whiskers chart.

另请参阅 QBoxPlotSeries .

成员类型文档编制

enum QBoxSet:: ValuePositions

This enum type defines the values of a box-and-whiskers item:

常量 描述
QBoxSet::LowerExtreme 0 The smallest value of the box-and-whiskers item.
QBoxSet::LowerQuartile 1 The median value of the lower half of the box-and-whiskers item.
QBoxSet::Median 2 The median value of the box-and-whiskers item.
QBoxSet::UpperQuartile 3 The median value of the upper half of the box-and-whiskers item.
QBoxSet::UpperExtreme 4 The largest value of the box-and-whiskers item.

特性文档编制

brush : QBrush

This property holds the brush used fill the box of the box-and-whiskers item.

访问函数:

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

通知程序信号:

void brushChanged ()

pen : QPen

This property holds the pen used to draw the lines of the box-and-whiskers item.

访问函数:

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

通知程序信号:

void penChanged ()

成员函数文档编制

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

Constructs a box-and-whiskers item with the optional label label 和父级 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 a box-and-whiskers item with the following ordered values: le specifies the lower extreme, lq the lower quartile, m the median, uq the upper quartile, and ue the upper quartile. Optionally, the label and parent can be specified.

[虚拟] QBoxSet:: ~QBoxSet ()

Destroys the a box-and-whiskers item.

void QBoxSet:: append (const qreal value )

Appends the new value specified by value to the end of the box-and-whiskers item.

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

Appends a list of real values specified by to the end of the box-and-whiskers item.

另请参阅 append ().

qreal QBoxSet:: at (const int index ) const

Returns the value of the box-and-whiskers item specified by index . The index can be specified by using ValuePositions enumeration values. If the index is out of bounds, 0.0 is returned.

QBrush QBoxSet:: brush () const

Returns the brush used to fill the box-and-whiskers item.

注意: Getter 函数对于特性 brush .

另请参阅 setBrush ().

[signal] void QBoxSet:: brushChanged ()

This signal is emitted when the brush of the box-and-whiskers item changes.

注意: 通知程序信号对于特性 brush .

另请参阅 brush .

void QBoxSet:: clear ()

Sets all the values of the box-and-whiskers item to 0.

[signal] void QBoxSet:: cleared ()

This signal is emitted when all the values of the box-and-whiskers item are set to 0.

[signal] void QBoxSet:: clicked ()

This signal is emitted when the user clicks a box-and-whiskers item in the chart.

int QBoxSet:: count () const

Returns the number of values appended to the box-and-whiskers item.

[signal] void QBoxSet:: doubleClicked ()

This signal is emitted when the user double-clicks a box-and-whiskers item.

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

This signal is emitted when a mouse is hovered over a box-and-whiskers item in a chart. When the mouse moves over the item, status turns true , and when the mouse moves away again, it turns false .

QString QBoxSet:: label () const

Returns the label of the category of the box-and-whiskers item.

另请参阅 setLabel ().

QPen QBoxSet:: pen () const

Returns the pen used to draw the box-and-whiskers item.

注意: Getter 函数对于特性 pen .

另请参阅 setPen ().

[signal] void QBoxSet:: penChanged ()

This signal is emitted when the pen of the box-and-whiskers item changes.

注意: 通知程序信号对于特性 pen .

另请参阅 pen .

[signal] void QBoxSet:: pressed ()

This signal is emitted when the user clicks a box-and-whiskers item in the chart and holds down the mouse button.

[signal] void QBoxSet:: released ()

This signal is emitted when the user releases the mouse press on a box-and-whiskers item.

void QBoxSet:: setBrush (const QBrush & brush )

Sets the brush used to fill the box-and-whiskers item to brush .

注意: Setter 函数对于特性 brush .

另请参阅 brush ().

void QBoxSet:: setLabel (const QString label )

Sets the label specified by label for the category of the box-and-whiskers item.

另请参阅 label ().

void QBoxSet:: setPen (const QPen & pen )

Sets the pen used to draw the box-and-whiskers item to pen .

注意: Setter 函数对于特性 pen .

另请参阅 pen ().

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

Sets the value specified by value in the position specified by index . The index can be specified by using the ValuePositions enumeration values.

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

This signal is emitted when the value of the box-and-whiskers item specified by index 被修改。

另请参阅 at ().

[signal] void QBoxSet:: valuesChanged ()

This signal is emitted when multiple values of the box-and-whiskers item change.

另请参阅 append ().

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

A convenience operator for appending the real value specified by value to the end of the box-and-whiskers item.

另请参阅 append ().

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

Returns the value of the box-and-whiskers item specified by index . The index can be specified by using ValuePositions enumeration values. If the index is out of bounds, 0.0 is returned.