在本页

QGraphsLine Class

QGraphsLine 类封装了图形上线条的属性。更多

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

属性

公共功能

QGraphsLine(QGraphsLine &&other)
QColor labelTextColor() const
QColor mainColor() const
qreal mainWidth() const
void setLabelTextColor(QColor newColor)
void setMainColor(QColor newColor)
void setMainWidth(qreal newWidth)
void setSubColor(QColor newColor)
void setSubWidth(qreal newWidth)
QColor subColor() const
qreal subWidth() const
void swap(QGraphsLine &other)
QGraphsLine &operator=(QGraphsLine &&other)

详细说明

属性文档

labelTextColor : QColor

轴标签文本的颜色。如果没有明确设置,该值由主题决定。

访问功能:

QColor labelTextColor() const
void setLabelTextColor(QColor newColor)

mainColor : QColor

主网格线或轴线的颜色。如果没有明确设置,该值由主题决定。

访问功能:

QColor mainColor() const
void setMainColor(QColor newColor)

mainWidth : qreal

主网格线或轴线的宽度,单位为像素。

访问功能:

qreal mainWidth() const
void setMainWidth(qreal newWidth)

subColor : QColor

子网格或轴线的颜色。如果未明确设置,该值由主题决定。

访问功能:

QColor subColor() const
void setSubColor(QColor newColor)

subWidth : qreal

子网格或轴线的宽度,单位为像素。

访问函数:

qreal subWidth() const
void setSubWidth(qreal newWidth)

成员函数文档

[constexpr noexcept] QGraphsLine::QGraphsLine(QGraphsLine &&other)

移动-从other 构建一个新的 QGraphsLine。

注意: moved-from 对象other 处于部分形成状态,其中唯一有效的操作是销毁和赋新值。

[noexcept] void QGraphsLine::swap(QGraphsLine &other)

QGraphsLine other 与此QGraphsLine 互换。这种操作速度非常快,从未出现过故障。

[noexcept] QGraphsLine &QGraphsLine::operator=(QGraphsLine &&other)

移动--将other 赋值给此QGraphsLine 实例。

注意: 从移动对象other 将处于部分形成状态,其中唯一有效的操作是销毁和赋新值。

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