QBarCategoryAxis 类

The QBarCategoryAxis class adds categories to a graph's axes. 更多...

头: #include <QBarCategoryAxis>
CMake: find_package(Qt6 REQUIRED COMPONENTS Graphs)
target_link_libraries(mytarget PRIVATE Qt6::Graphs)
qmake: QT += graphs
在 QML: BarCategoryAxis
继承: QAbstractAxis

特性

公共函数

QBarCategoryAxis (QObject * parent = nullptr)
virtual ~QBarCategoryAxis () override
void append (const QString & category )
void append (const QStringList & categories )
QString at (qsizetype index ) const
QStringList categories ()
void clear ()
qsizetype count () const
void insert (qsizetype index , const QString & category )
QString max () const
QString min () const
void remove (const QString & category )
void remove (qsizetype index )
void replace (const QString & oldCategory , const QString & newCategory )
void setCategories (const QStringList & categories )
void setMax (const QString & max )
void setMin (const QString & min )
void setRange (const QString & minCategory , const QString & maxCategory )

重实现公共函数

virtual QAbstractAxis::AxisType type () const override

信号

void categoriesChanged ()
void countChanged ()
void maxChanged (const QString & max )
void minChanged (const QString & min )

详细描述

QBarCategoryAxis can be set up to show an axis line with tick marks, grid lines, and shades. Categories are drawn between the ticks.

特性文档编制

categories : QStringList

This property holds the categories of an axis.

访问函数:

QStringList categories ()
void setCategories (const QStringList & categories )

通知程序信号:

void categoriesChanged ()

[read-only] count : const qsizetype

This property holds the number of categories of an axis.

访问函数:

qsizetype count () const

通知程序信号:

void countChanged ()

max : QString

此特性保持轴的最大值。

The maximum value on the axis. The given value should be contained in categories .

访问函数:

QString max () const
void setMax (const QString & max )

通知程序信号:

void maxChanged (const QString & max )

min : QString

此特性保持轴的最小值。

The minimum value on the axis. The given value should be contained in categories .

访问函数:

QString min () const
void setMin (const QString & min )

通知程序信号:

void minChanged (const QString & min )

成员函数文档编制

[explicit] QBarCategoryAxis:: QBarCategoryAxis ( QObject * parent = nullptr)

Constructs an axis object that is the child of parent .

[override virtual noexcept] QBarCategoryAxis:: ~QBarCategoryAxis ()

Destroys the axis object.

[invokable] void QBarCategoryAxis:: append (const QString & category )

追加 category to an axis. The maximum value on the axis will be changed to match the last category . If no categories were previously defined, the minimum value on the axis will also be changed to match category .

A category has to be a valid QString and it cannot be duplicated. Duplicated categories will not be appended.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

[invokable] void QBarCategoryAxis:: append (const QStringList & categories )

追加 categories to an axis. The maximum value on the axis will be changed to match the last category in categories . If no categories were previously defined, the minimum value on the axis will also be changed to match the first category in categories .

A category has to be a valid QString and it cannot be duplicated. Duplicated categories will not be appended.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

[invokable] QString QBarCategoryAxis:: at ( qsizetype index ) const

Returns the category at index .

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

QStringList QBarCategoryAxis:: categories ()

Returns categories.

注意: Getter function for property categories.

另请参阅 setCategories ().

[invokable] void QBarCategoryAxis:: clear ()

Removes all categories. Sets the maximum and minimum values of the axis range to QString::null.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

qsizetype QBarCategoryAxis:: count () const

Returns the number of categories.

注意: getter 函数对于特性 count。

[invokable] void QBarCategoryAxis:: insert ( qsizetype index , const QString & category )

插入 category to the axis at index . category has to be a valid QString and it cannot be duplicated. If category is prepended or appended to other categories, the minimum and maximum values on the axis are updated accordingly.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

QString QBarCategoryAxis:: max () const

Returns the maximum category.

注意: Getter function for property max.

另请参阅 setMax ().

QString QBarCategoryAxis:: min () const

Returns the minimum category.

注意: Getter function for property min.

另请参阅 setMin ().

[invokable] void QBarCategoryAxis:: remove (const QString & category )

移除 category from the axis. Removing a category that currently sets the maximum or minimum value on the axis will affect the axis range.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

[invokable] void QBarCategoryAxis:: remove ( qsizetype index )

Removes a category at index from the axis. Removing a category that currently sets the maximum or minimum value on the axis will affect the axis range.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

[invokable] void QBarCategoryAxis:: replace (const QString & oldCategory , const QString & newCategory )

替换 oldCategory with newCategory 。若 oldCategory does not exist on the axis, nothing is done. newCategory has to be a valid QString and it cannot be duplicated. If the minimum or maximum category is replaced, the minimum and maximum values on the axis are updated accordingly.

注意: 此函数可以被援引,通过元对象系统和从 QML。见 Q_INVOKABLE .

void QBarCategoryAxis:: setCategories (const QStringList & categories )

设置 categories and discards the old ones. The axis range is adjusted to match the first and last category in categories .

A category has to be a valid QString and it cannot be duplicated.

注意: setter 函数对于特性 categories .

另请参阅 categories ().

void QBarCategoryAxis:: setMax (const QString & max )

Sets the maximum category to max .

注意: setter 函数对于特性 max .

另请参阅 max ().

void QBarCategoryAxis:: setMin (const QString & min )

Sets the minimum category to min .

注意: setter 函数对于特性 min .

另请参阅 min ().

void QBarCategoryAxis:: setRange (const QString & minCategory , const QString & maxCategory )

Sets the axis range from minCategory to maxCategory .

[override virtual] QAbstractAxis::AxisType QBarCategoryAxis:: type () const

重实现: QAbstractAxis::type () const.

返回轴的类型。