本页内容

QBarDataItem Class

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

头文件: #include <QBarDataItem>
CMake: find_package(Qt6 REQUIRED COMPONENTS Graphs)
target_link_libraries(mytarget PRIVATE Qt6::Graphs)
qmake: QT += graphs

公共函数

QBarDataItem()
QBarDataItem(float value)
QBarDataItem(float value, float angle)
float rotation() const
void setRotation(float angle)
void setValue(float val)
float value() const

详细说明

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

另请参阅 QBarDataProxy 和Qt Graphs C++ 3D 类。

成员函数文档

[constexpr noexcept default] QBarDataItem::QBarDataItem()

创建一个条形图数据项。

[explicit constexpr noexcept] QBarDataItem::QBarDataItem(float value)

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

[explicit constexpr noexcept] QBarDataItem::QBarDataItem(float value, float angle)

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

[constexpr noexcept] float QBarDataItem::rotation() const

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

另请参阅 setRotation()。

[constexpr noexcept] void QBarDataItem::setRotation(float angle)

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

另请参阅 rotation()。

[constexpr noexcept] void QBarDataItem::setValue(float val)

将值val 设置为该数据项。

另请参阅 value()。

[constexpr noexcept] float QBarDataItem::value() const

返回该数据项的值。

另请参阅 setValue()。

© 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.