QBarDataItem Class

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

Header: #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 实例。

另请参阅 QBarDataProxyQt Graphs 适用于 3D 的 C++ 类

成员函数文档

[constexpr noexcept] 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()。

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