本页内容

QLogValue3DAxisFormatter Class

QLogValue3DAxisFormatter 类为对数值轴提供了格式化规则。更多内容...

头文件: #include <QLogValue3DAxisFormatter>
CMake: find_package(Qt6 REQUIRED COMPONENTS DataVisualization)
target_link_libraries(mytarget PRIVATE Qt6::DataVisualization)
qmake: QT += datavisualization
自: QtDataVisualization 1.1
在 QML 中: LogValueAxis3DFormatter
继承自: QValue3DAxisFormatter
状态: 已弃用

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

属性

公共函数

QLogValue3DAxisFormatter(QObject *parent = nullptr)
virtual ~QLogValue3DAxisFormatter()
bool autoSubGrid() const
qreal base() const
void setAutoSubGrid(bool enabled)
void setBase(qreal base)
void setShowEdgeLabels(bool enabled)
bool showEdgeLabels() const

信号

void autoSubGridChanged(bool enabled)
void baseChanged(qreal base)
void showEdgeLabelsChanged(bool enabled)

详细说明

当格式化器附加到值轴时,该轴的范围不能包含负值或零。

另请参阅 QValue3DAxisFormatter 。

属性文档

autoSubGrid : bool

该属性控制是否自动生成子网格位置。

如果此属性值设置为true ,则在计算子网格线位置时将忽略父轴的子分段数。子网格位置将根据base 属性值自动生成。子网格线的数量设置为基数减一(向下取整)。当基数为零时,此属性将被忽略。默认值为true 。

访问函数:

bool autoSubGrid() const
void setAutoSubGrid(bool enabled)

通知信号:

void autoSubGridChanged(bool enabled)

另请参阅 base 和QValue3DAxis::subSegmentCount 。

base : qreal

此属性存储用于映射坐标轴值的对数底数。

如果底数不为零,在计算网格线和标签位置时,将忽略父轴的刻度段数。若希望该范围像普通数值轴一样被划分为等分段,请将此属性值设置为零。

底数必须为零或正数,且不能等于一。默认值为十。

访问函数:

qreal base() const
void setBase(qreal base)

通知信号:

void baseChanged(qreal base)

另请参阅 QValue3DAxis::segmentCount 。

showEdgeLabels : bool

该属性控制轴上的第一个和最后一个标签是否可见。

当base 属性值不为零时,整个坐标轴范围通常不会被均等地划分为多个区间。 第一个和最后一个区段通常比其他区段更小。在极端情况下,这可能会导致第一个和最后两个网格线上的标签发生重叠。通过将此属性设置为false ,当区段与坐标轴不完全吻合时,您可以抑制显示该坐标轴的最小值和最大值标签。默认值为true 。

访问函数:

bool showEdgeLabels() const
void setShowEdgeLabels(bool enabled)

通知信号:

void showEdgeLabelsChanged(bool enabled)

另请参阅 base 和QAbstract3DAxis::labels 。

成员函数文档

[explicit] QLogValue3DAxisFormatter::QLogValue3DAxisFormatter(QObject *parent = nullptr)

创建一个新的对数值 3D 坐标轴格式化器,并可选地指定父对象为parent 。

[virtual noexcept] QLogValue3DAxisFormatter::~QLogValue3DAxisFormatter()

删除对数值 3D 轴格式化器。

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