Skip to content

Class QAccelPlot::Category

ClassList > QAccelPlot > Category

One category of a BarSeries orRectangleSeries : a value, a name, and a fill color.More...

  • #include <Category.hpp>

Inherits the following classes: QObject

Inheritance diagram

flowchart TB
  classQAccelPlot_1_1Category["QAccelPlot::Category"]

  external_base_classQAccelPlot_1_1Category_1["QObject"]
  external_base_classQAccelPlot_1_1Category_1 --> classQAccelPlot_1_1Category

Public Properties

Type Name
property QColor color
Fill color. Default: an invalid color, which uses the series color .
property QString name
Name for the legend, categoryName , and QML data. Default: empty.
property int value
Value that data points carry as their category . Default: 0.

Public Signals

Type Name
signal void colorChanged
Emitted when the color property changes.
signal void nameChanged
Emitted when the name property changes.
signal void valueChanged
Emitted when the value property changes.

Public Functions

Type Name
Category (QObject * parent=nullptr)
Constructs a category with value 0, no name, and no color, owned by parent .
Category (int value, QString name, const QColor & color, QObject * parent=nullptr)
Constructs a category with value _,_name , and__color , owned by__parent .
QColor color () const
Returns the fill color.
QString name () const
Returns the name.
void setColor (const QColor & color)
Sets the fill color to color . An invalid color uses the seriescolor .
void setName (const QString & name)
Sets the name to name .
void setValue (int value)
Sets the value data points carry to value .
int value () const
Returns the value data points carry.

Detailed Description

Data points carry the category value as their category. The name labels the category in the legend and in barAt() / rectangleAt(), and QML data can use it instead of the value.

QAccelPlot.RectangleSeries {
    categories: [
        QAccelPlot.Category { value: 0; name: "Running"; color: "seagreen" },
        QAccelPlot.Category { value: 1; name: "Alarm"; color: "firebrick" }
    ]
}

See also: BarSeries::categories, RectangleSeries::categories

Public Properties Documentation

property color

Fill color. Default: an invalid color, which uses the series color .

QColor QAccelPlot::Category::color;


property name

Name for the legend, categoryName , and QML data. Default: empty.

QString QAccelPlot::Category::name;


property value

Value that data points carry as their category . Default: 0.

int QAccelPlot::Category::value;


Public Signals Documentation

signal colorChanged

Emitted when the color property changes.

void QAccelPlot::Category::colorChanged;


signal nameChanged

Emitted when the name property changes.

void QAccelPlot::Category::nameChanged;


signal valueChanged

Emitted when the value property changes.

void QAccelPlot::Category::valueChanged;


Public Functions Documentation

function Category

Constructs a category with value 0, no name, and no color, owned by parent .

explicit QAccelPlot::Category::Category (
    QObject * parent=nullptr
) 


function Category

Constructs a category with value _,_name , and__color , owned by__parent .

QAccelPlot::Category::Category (
    int value,
    QString name,
    const QColor & color,
    QObject * parent=nullptr
) 


function color

Returns the fill color.

QColor QAccelPlot::Category::color () const


function name

Returns the name.

QString QAccelPlot::Category::name () const


function setColor

Sets the fill color to color . An invalid color uses the seriescolor .

void QAccelPlot::Category::setColor (
    const QColor & color
) 


function setName

Sets the name to name .

void QAccelPlot::Category::setName (
    const QString & name
) 


function setValue

Sets the value data points carry to value .

void QAccelPlot::Category::setValue (
    int value
) 


function value

Returns the value data points carry.

int QAccelPlot::Category::value () const



The documentation for this class was generated from the following file QAccelPlot/src/QAccelPlot/series/Category.hpp