QXYModelMapper Class
QXYModelMapper 类是一个用于线、样条和散点序列的模型映射器。更多内容...
| 标题: | #include <QXYModelMapper> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Graphs) target_link_libraries(mytarget PRIVATE Qt6::Graphs) |
| qmake: | QT += graphs |
| 在 QML 中: | XYModelMapper |
| 继承自: | QObject |
- 所有成员列表(包括继承的成员)
- QXYModelMapper 属于Qt Graphs 的2D C++ 类库。
属性
|
公共函数
| qsizetype | count() const |
| qsizetype | first() const |
| QAbstractItemModel * | model() const |
| Qt::Orientation | orientation() const |
| QXYSeries * | series() const |
| void | setCount(qsizetype count) |
| void | setFirst(qsizetype first) |
| void | setModel(QAbstractItemModel *model) |
| void | setOrientation(Qt::Orientation orientation) |
| void | setSeries(QXYSeries *series) |
| void | setXSection(qsizetype xSection) |
| void | setYSection(qsizetype ySection) |
| qsizetype | xSection() const |
| qsizetype | ySection() const |
信号
| void | countChanged() |
| void | firstChanged() |
| void | modelChanged() |
| void | orientationChanged() |
| void | seriesChanged() |
| void | xSectionChanged() |
| void | ySectionChanged() |
受保护函数
| QXYModelMapper(const QXYModelMapper &) | |
| QXYModelMapper(QXYModelMapper &&) | |
| QXYModelMapper & | operator=(QXYModelMapper &&) |
| QXYModelMapper & | operator=(const QXYModelMapper &) |
详细说明
模型映射器允许将从QAbstractItemModel 类派生的数据模型用作图形的数据源。模型映射器用于在线段、样条曲线或散点系列之间建立连接。TableModel是该模型的自然选择。
既可以使用模型属性,也可以使用序列属性来操作数据。模型映射器会保持序列与数据模型之间的同步。
另请参阅 QXYSeries 。
属性文档
count : qsizetype
该属性存储了模型中映射为系列数据的行数。
其最小值和默认值为 -1(该数值受模型中行数的限制)。
访问函数:
| qsizetype | count() const |
| void | setCount(qsizetype count) |
通知信号:
| void | countChanged() |
另请参阅 QXYModelMapper::orientation 。
first : qsizetype
该属性保存模型中包含该序列第一个数据点数据的行。
其最小值和默认值均为 0。
访问函数:
| qsizetype | first() const |
| void | setFirst(qsizetype first) |
通知信号:
| void | firstChanged() |
另请参阅 QXYModelMapper::orientation 。
model : QAbstractItemModel*
该属性保存了映射器所使用的模型。
访问函数:
| QAbstractItemModel * | model() const |
| void | setModel(QAbstractItemModel *model) |
通知器信号:
| void | modelChanged() |
orientation : Qt::Orientation
用于告知模型映射器如何映射模型中的数据。如果使用Qt::Vertical ,则模型的每一列都定义一组条形,而模型的每一行则定义类别。当方向设置为Qt::Horizontal 时,模型的每一行都定义一组条形,而模型的每一列则定义类别。
默认值为Qt::Vertical
访问函数:
| Qt::Orientation | orientation() const |
| void | setOrientation(Qt::Orientation orientation) |
通知信号:
| void | orientationChanged() |
series : QXYSeries*
该属性存储映射器所使用的系列。
当该系列被设置为映射器时,其中的所有数据都会被丢弃。当指定新系列时,旧系列将被断开连接(但其数据仍会被保留)。
访问函数:
| QXYSeries * | series() const |
| void | setSeries(QXYSeries *series) |
通知信号:
| void | seriesChanged() |
xSection : qsizetype
该属性存储模型中包含数据点 x 坐标的区域。
默认值为 -1(映射无效)。
访问函数:
| qsizetype | xSection() const |
| void | setXSection(qsizetype xSection) |
通知信号:
| void | xSectionChanged() |
另请参阅 QXYModelMapper::orientation 。
ySection : qsizetype
该属性存储了模型中包含数据点 y 坐标的区域。
默认值为 -1(映射无效)。
访问函数:
| qsizetype | ySection() const |
| void | setYSection(qsizetype ySection) |
通知信号:
| void | ySectionChanged() |
另请参阅 QXYModelMapper::orientation 。
成员函数文档
[protected delete] QXYModelMapper::QXYModelMapper(const QXYModelMapper &)
复制并构造一个QXYModelMapper 实例。该函数已被删除。
[protected delete] QXYModelMapper::QXYModelMapper(QXYModelMapper &&)
通过移动构造一个QXYModelMapper 实例。此函数已被删除。
[protected delete] QXYModelMapper &QXYModelMapper::operator=(QXYModelMapper &&)
将other 通过“移动赋值”操作赋值给该QXYModelMapper 实例。此函数已被删除。
[protected delete] QXYModelMapper &QXYModelMapper::operator=(const QXYModelMapper &)
将 `other ` 复制并赋值给该 `QXYModelMapper ` 实例。此函数已被删除。
© 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.