QAbstract3DAxis Class
QAbstract3DAxis 类是 3D 图形坐标轴的基类。更多内容...
| 头文件: | #include <QAbstract3DAxis> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Graphs) target_link_libraries(mytarget PRIVATE Qt6::Graphs) |
| qmake: | QT += graphs |
| 在 QML 中: | Abstract3DAxis |
| 继承自: | QObject |
| 被继承自: |
- 所有成员列表(包括继承的成员)
- QAbstract3DAxis 属于Qt Graphs 的3D C++ 类库。
公共类型
| enum class | AxisOrientation { None, X, Y, Z } |
| enum class | AxisType { None, Category, Value } |
属性
|
|
公共函数
| virtual | ~QAbstract3DAxis() override |
| bool | isAutoAdjustRange() const |
| bool | isScaleLabelsByCount() const |
| bool | isTitleFixed() const |
| bool | isTitleVisible() const |
| float | labelAutoAngle() const |
| qreal | labelSize() const |
| QStringList | labels() const |
| bool | labelsVisible() const |
| float | max() const |
| float | min() const |
| QAbstract3DAxis::AxisOrientation | orientation() const |
| void | setAutoAdjustRange(bool autoAdjust) |
| void | setLabelAutoAngle(float degree) |
| void | setLabelSize(qreal size) |
| void | setLabels(const QStringList &labels) |
| void | setLabelsVisible(bool visible) |
| void | setMax(float max) |
| void | setMin(float min) |
| void | setRange(float min, float max) |
| void | setScaleLabelsByCount(bool adjust) |
| void | setTitle(const QString &title) |
| void | setTitleFixed(bool fixed) |
| void | setTitleOffset(float offset) |
| void | setTitleVisible(bool visible) |
| QString | title() const |
| float | titleOffset() const |
| QAbstract3DAxis::AxisType | type() const |
信号
| void | autoAdjustRangeChanged(bool autoAdjust) |
| void | labelAutoAngleChanged(float angle) |
| void | labelSizeChanged(qreal size) |
| void | labelVisibleChanged(bool visible) |
| void | labelsChanged() |
| void | maxChanged(float value) |
| void | minChanged(float value) |
| void | orientationChanged(QAbstract3DAxis::AxisOrientation orientation) |
| void | rangeChanged(float min, float max) |
| void | scaleLabelsByCountChanged(bool adjust) |
| void | titleChanged(const QString &newTitle) |
| void | titleFixedChanged(bool fixed) |
| void | titleOffsetChanged(float offset) |
| void | titleVisibleChanged(bool visible) |
另请参阅 QCategory3DAxis 和QValue3DAxis 。
成员类型文档
enum class QAbstract3DAxis::AxisOrientation
轴对象的方向。
| 常量 | 值 |
|---|---|
QAbstract3DAxis::AxisOrientation::None | 0 |
QAbstract3DAxis::AxisOrientation::X | 1 |
QAbstract3DAxis::AxisOrientation::Y | 2 |
QAbstract3DAxis::AxisOrientation::Z | 3 |
enum class QAbstract3DAxis::AxisType
轴对象的类型。
| 常量 | 值 |
|---|---|
QAbstract3DAxis::AxisType::None | 0 |
QAbstract3DAxis::AxisType::Category | 1 |
QAbstract3DAxis::AxisType::Value | 2 |
属性文档
autoAdjustRange : bool
此属性控制坐标轴是否会自动调整范围,以确保所有数据都能显示在其中。
访问函数:
| bool | isAutoAdjustRange() const |
| void | setAutoAdjustRange(bool autoAdjust) |
通知信号:
| void | autoAdjustRangeChanged(bool autoAdjust) |
另请参阅 setRange()、setMin() 以及setMax()。
labelAutoAngle : float
该属性用于指定当摄像机角度发生变化时,标签可自动旋转的最大角度。
该角度的取值范围为 0 到 90 度(含 0 和 90 度)。默认值为 0。若值为 0,坐标轴标签不会自动旋转。若值大于零,标签将尝试朝向摄像头调整方向,最大旋转角度不超过指定值。
访问函数:
| float | labelAutoAngle() const |
| void | setLabelAutoAngle(float degree) |
通知信号:
| void | labelAutoAngleChanged(float angle) |
[since 6.9] labelSize : qreal
标签的大小
标签的大小。该值的默认值为1.0 。
该枚举类型在 Qt 6.9 中引入。
访问函数:
| qreal | labelSize() const |
| void | setLabelSize(qreal size) |
通知信号:
| void | labelSizeChanged(qreal size) |
另请参阅 scaleLabelsByCount 。
labels : QStringList
该属性用于存储坐标轴的标签。
注意: 为QValue3DAxis 设置 此属性不会产生任何效果,因为它会自动生成标签。
访问函数:
| QStringList | labels() const |
| void | setLabels(const QStringList &labels) |
通知信号:
| void | labelsChanged() |
labelsVisible : bool
该属性控制主图表视图中是否显示坐标轴标签。
默认值为true 。
访问函数:
| bool | labelsVisible() const |
| void | setLabelsVisible(bool visible) |
通知信号:
| void | labelVisibleChanged(bool visible) |
max : float
该属性存储了该轴上的最大值。
设置此属性时,系统会根据需要调整最小值,以确保该范围仍然有效。
注意:对于 QCategory3DAxis ,指定要显示的最后一行或最后一列的索引。
访问函数:
| float | max() const |
| void | setMax(float max) |
通知信号:
| void | maxChanged(float value) |
min : float
该属性存储了轴上的最小值。
设置此属性时,系统会根据需要调整最大值,以确保该范围仍然有效。
注意:对于 QCategory3DAxis ,指定要显示的第一行或第一列的索引。
访问函数:
| float | min() const |
| void | setMin(float min) |
通知信号:
| void | minChanged(float value) |
[read-only] orientation : QAbstract3DAxis::AxisOrientation
该属性存储轴的方向。
该值是AxisOrientation 值之一。
访问函数:
| QAbstract3DAxis::AxisOrientation | orientation() const |
通知信号:
| void | orientationChanged(QAbstract3DAxis::AxisOrientation orientation) |
[since 6.9] scaleLabelsByCount : bool
该属性决定了标签是否会根据标签总数自动调整大小
该枚举在 Qt 6.9 中引入。
访问函数:
| bool | isScaleLabelsByCount() const |
| void | setScaleLabelsByCount(bool adjust) |
通知信号:
| void | scaleLabelsByCountChanged(bool adjust) |
另请参阅 labelSize()。
title : QString
该属性用于指定坐标轴的标题。
访问函数:
| QString | title() const |
| void | setTitle(const QString &title) |
通知信号:
| void | titleChanged(const QString &newTitle) |
另请参阅 titleVisible 和titleFixed 。
titleFixed : bool
该属性控制坐标轴标题的旋转角度。
如果false ,主图视图中的坐标轴标题将与坐标轴标签类似,朝向摄像机旋转。如果true ,坐标轴标题仅围绕其轴线旋转,但不会朝向摄像机。如果labelAutoAngle 属性的值为零,则此属性无效。默认值为true 。
访问函数:
| bool | isTitleFixed() const |
| void | setTitleFixed(bool fixed) |
通知器信号:
| void | titleFixedChanged(bool fixed) |
另请参阅 labelAutoAngle 、title 以及titleVisible 。
titleOffset : float
坐标轴上轴标题的位置。该值必须介于-1.0f 和1.0f
访问函数:
| float | titleOffset() const |
| void | setTitleOffset(float offset) |
通知信号:
| void | titleOffsetChanged(float offset) |
另请参阅 title 和titleFixed 。
titleVisible : bool
该属性控制轴标题在主图表视图中是否可见。
默认值为false 。
访问函数:
| bool | isTitleVisible() const |
| void | setTitleVisible(bool visible) |
通知信号:
| void | titleVisibleChanged(bool visible) |
另请参阅 title 和titleFixed 。
[read-only] type : const QAbstract3DAxis::AxisType
该属性存储轴的类型。
该值属于AxisType 中的某个值。
访问函数:
| QAbstract3DAxis::AxisType | type() const |
成员函数文档
[override virtual noexcept] QAbstract3DAxis::~QAbstract3DAxis()
销毁QAbstract3DAxis 。
[signal] void QAbstract3DAxis::rangeChanged(float min, float max)
当范围发生变化时,会返回该范围的最小值和最大值:min 和max 。
void QAbstract3DAxis::setRange(float min, float max)
将坐标轴的值范围从min 设置为max 。设置范围时,系统会根据需要调整最大值,以确保该范围仍然有效。
注意:对于 QCategory3DAxis ,指定要显示的行或列的索引范围。
© 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.