QAbstract3DAxis Class
QAbstract3DAxis 类是图形坐标轴的基类。更多
Header: | #include <QAbstract3DAxis> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS DataVisualization) target_link_libraries(mytarget PRIVATE Qt6::DataVisualization) |
qmake: | QT += datavisualization |
自 | QtDataVisualization 1.0 |
在 QML 中: | AbstractAxis3D |
继承于: | QObject |
继承于: |
公共类型
enum | AxisOrientation { AxisOrientationNone, AxisOrientationX, AxisOrientationY, AxisOrientationZ } |
enum | AxisType { AxisTypeNone, AxisTypeCategory, AxisTypeValue } |
属性
|
|
公共功能
virtual | ~QAbstract3DAxis() |
bool | isAutoAdjustRange() const |
bool | isTitleFixed() const |
bool | isTitleVisible() const |
float | labelAutoRotation() const |
QStringList | labels() const |
float | max() const |
float | min() const |
QAbstract3DAxis::AxisOrientation | orientation() const |
void | setAutoAdjustRange(bool autoAdjust) |
void | setLabelAutoRotation(float angle) |
void | setLabels(const QStringList &labels) |
void | setMax(float max) |
void | setMin(float min) |
void | setRange(float min, float max) |
void | setTitle(const QString &title) |
void | setTitleFixed(bool fixed) |
void | setTitleVisible(bool visible) |
QString | title() const |
QAbstract3DAxis::AxisType | type() const |
信号
void | autoAdjustRangeChanged(bool autoAdjust) |
void | labelAutoRotationChanged(float angle) |
void | labelsChanged() |
void | maxChanged(float value) |
void | minChanged(float value) |
void | orientationChanged(QAbstract3DAxis::AxisOrientation orientation) |
void | rangeChanged(float min, float max) |
void | titleChanged(const QString &newTitle) |
void | titleFixedChanged(bool fixed) |
void | titleVisibilityChanged(bool visible) |
另请参阅 QCategory3DAxis 和QValue3DAxis 。
成员类型文档
enum QAbstract3DAxis::AxisOrientation
轴对象的方向。
常数 | 值 |
---|---|
QAbstract3DAxis::AxisOrientationNone | 0 |
QAbstract3DAxis::AxisOrientationX | 1 |
QAbstract3DAxis::AxisOrientationY | 2 |
QAbstract3DAxis::AxisOrientationZ | 4 |
enum QAbstract3DAxis::AxisType
轴对象的类型。
常数 | 值 |
---|---|
QAbstract3DAxis::AxisTypeNone | 0 |
QAbstract3DAxis::AxisTypeCategory | 1 |
QAbstract3DAxis::AxisTypeValue | 2 |
属性文档
autoAdjustRange : bool
该属性用于确定轴是否会自动调整范围,以便所有数据都适合该范围。
访问功能:
bool | isAutoAdjustRange() const |
void | setAutoAdjustRange(bool autoAdjust) |
Notifier 信号:
void | autoAdjustRangeChanged(bool autoAdjust) |
另请参见 setRange()、setMin() 和setMax()。
labelAutoRotation : float
当摄像机角度发生变化时,该属性表示标签可以自动旋转的最大角度。
角度范围为 0 至 90(含 90),默认值为 0。默认值为 0。如果值为 0,轴标签不会自动旋转。如果该值大于 0,标签会尝试朝向摄像机,直至达到指定角度。
访问功能:
float | labelAutoRotation() const |
void | setLabelAutoRotation(float angle) |
通知信号:
void | labelAutoRotationChanged(float angle) |
labels : QStringList
此属性用于保存轴的标签。
注意: 为QValue3DAxis 设置此属性没有任何作用,因为它会自动生成标签。
访问功能:
QStringList | labels() const |
void | setLabels(const QStringList &labels) |
通知信号:
void | labelsChanged() |
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 : const AxisOrientation
该属性表示轴的方向。
该值是AxisOrientation 值之一。
访问功能:
QAbstract3DAxis::AxisOrientation | orientation() const |
通知信号:
void | orientationChanged(QAbstract3DAxis::AxisOrientation orientation) |
title : QString
此属性用于保存轴的标题。
访问功能:
QString | title() const |
void | setTitle(const QString &title) |
通知信号:
void | titleChanged(const QString &newTitle) |
另请参阅 titleVisible 和titleFixed 。
titleFixed : bool
此属性用于设置轴标题的旋转。
如果true
,主图视图中的轴标题将与轴标签一样朝摄像机方向旋转。如果false
,轴标题只会绕轴旋转,而不会朝向摄像机。如果labelAutoRotation 属性值为零,则此属性不会有任何影响。默认值为true
。
访问功能:
bool | isTitleFixed() const |
void | setTitleFixed(bool fixed) |
Notifier 信号:
void | titleFixedChanged(bool fixed) |
另请参阅 labelAutoRotation,title, 和titleVisible 。
titleVisible : bool
该属性用于确定在主图表视图中轴标题是否可见。
默认值为false
。
访问功能:
bool | isTitleVisible() const |
void | setTitleVisible(bool visible) |
Notifier 信号:
void | titleVisibilityChanged(bool visible) |
另请参阅 title 和titleFixed 。
[read-only]
type : const AxisType
此属性表示轴的类型。
其值为AxisType 值之一。
访问函数:
QAbstract3DAxis::AxisType | type() const |
成员函数文档
[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 ,指定要显示的行或列的索引范围。
© 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.