XYModelMapper QML Type
| Import Statement: | import QtGraphs |
| In C++: | QXYModelMapper |
- 所有成员(包括继承成员)列表
- XYModelMapper 是Qt Graphs QML Types for 2D 的一部分。
属性
- count : qsizetype
- first : qsizetype
- model : SomeModel
- orientation : orientation
- series : XYSeries
- xSection : qsizetype
- ySection : qsizetype
信号
详细说明
模型映射器可将源自QAbstractItemModel 类的数据模型用作图表的数据源。模型映射器用于在直线、样条线或散点序列之间创建连接。表模型是模型的自然选择。
模型和序列属性都可用于操作数据。模型映射器可使序列和数据模型保持同步。
另请参见 XYSeries 。
属性文档
count : qsizetype
映射为序列数据的模型行数。默认值为-1(行数受模型行数限制)。
另请参阅 orientation 。
first : qsizetype
模型中包含序列第一点数据的行。默认值为 0。
另请参阅 orientation 。
model : SomeModel
映射器使用的数据模型。您需要实现该模型,并将其公开给 QML。
注意: 模型必须支持添加和删除行或列,以及修改单元格中的数据。
orientation : orientation
告诉 modelmapper 如何映射模型中的数据。如果使用Qt.Vertical ,模型有X和Y列,模型的行定义数据点。当方向设置为Qt.Horizontal 时,模型有X和Y行,模型的列定义数据点。
series : XYSeries
映射器使用的系列。系列中的所有数据在设置给映射器时都会被丢弃。指定新系列时,旧系列将被断开(但保留其数据)。
xSection : qsizetype
模型中包含数据点 x 坐标的部分。默认值为-1(无效映射)。
另请参阅 orientation 。
ySection : qsizetype
模型中包含数据点 Y 坐标的部分。默认值为-1(无效映射)。
另请参阅 orientation 。
信号文档
countChanged()
行数发生变化时会发出该信号。
注: 相应的处理程序是onCountChanged 。
firstChanged()
该信号在第一行发生变化时发出。
注: 相应的处理程序是onFirstChanged 。
modelChanged()
当映射器所连接的模型发生变化时会发出该信号。
注: 相应的处理程序是onModelChanged 。
seriesChanged()
当映射器所连接的系列发生变化时会发出该信号。
注: 相应的处理程序是onSeriesChanged 。
xSectionChanged()
当包含数据点 x 坐标的部分发生变化时,会发出该信号。
注: 相应的处理程序是onXSectionChanged 。
ySectionChanged()
当包含数据点 y 坐标的部分发生变化时,会发出该信号。
注: 相应的处理程序是onYSectionChanged 。
© 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.