本页内容

QBarDataItem Class

QBarDataItem 类提供了一个用于将已解析的数据添加到条形图中的容器。更多内容...

头文件: #include <QBarDataItem>
CMake: find_package(Qt6 REQUIRED COMPONENTS DataVisualization)
target_link_libraries(mytarget PRIVATE Qt6::DataVisualization)
qmake: QT += datavisualization
自: QtDataVisualization 1.0
状态: 已弃用

该类已弃用。我们强烈建议不要在新代码中使用它。

公共函数

QBarDataItem()
QBarDataItem(float value)
QBarDataItem(float value, float angle)
QBarDataItem(const QBarDataItem &other)
~QBarDataItem()
float rotation() const
void setRotation(float angle)
void setValue(float val)
float value() const
QBarDataItem &operator=(const QBarDataItem &other)

详细说明

条形数据项用于存储图表中单个已渲染条形的数据。条形数据代理会将数据解析为 QBarDataItem 实例以供可视化。

另请参阅 QBarDataProxy 和 Qt Data Visualization C++ Classes。

成员函数文档

QBarDataItem::QBarDataItem()

创建一个条形图数据项。

QBarDataItem::QBarDataItem(float value)

创建一个值为value 的条形图数据项。

QBarDataItem::QBarDataItem(float value, float angle)

创建一个条形数据项,其值为value ,角度为angle 。

QBarDataItem::QBarDataItem(const QBarDataItem &other)

创建other 的副本。

[noexcept] QBarDataItem::~QBarDataItem()

删除一个条形数据项。

float QBarDataItem::rotation() const

返回该数据项的旋转角度(单位:度)。

另请参阅 setRotation()。

void QBarDataItem::setRotation(float angle)

设置该数据项的旋转角度angle (单位:度)。

另请参阅 rotation()。

void QBarDataItem::setValue(float val)

将值val 设置为该数据项。

另请参阅 value()。

float QBarDataItem::value() const

返回该数据项的值。

另请参阅 setValue()。

QBarDataItem &QBarDataItem::operator=(const QBarDataItem &other)

将other 的副本分配给此对象。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.