VXYModelMapper QML Type
| Import Statement: | import QtCharts 2.12 |
| In C++: | QVXYModelMapper |
| Status: | Deprecated |
此类型已弃用。我们强烈建议不要在新代码中使用它。
属性
详细说明
模型映射器允许将源自QAbstractItemModel 类的数据模型用作图表的数据源。垂直模型映射器用于在线、样条或散点系列与数据模型之间建立连接,该数据模型包含用于坐标的X和Y列,并将XYSeries 的数据点作为行存储。TableModel是该模型的自然选择。
既可以使用模型属性,也可以使用序列属性来操作数据。模型映射器会保持序列与数据模型之间的同步。
另请参阅 HXYModelMapper 、XYSeries 以及带小部件的图表示例库。
属性文档
firstRow : int
模型中包含该时间序列第一个数据点数据的行。默认值为 0。
model : SomeModel
映射器所使用的数据模型。您需要实现该模型,并将其暴露给 QML。
注意:该 模型必须支持添加和删除行或列,以及修改单元格中的数据。
rowCount : int
模型中作为系列数据映射的行数。默认值为 -1(该数值受模型中行数的限制)。
series : XYSeries
映射器所使用的系列。当该系列被设置为映射器时,其中的所有数据都会被丢弃。指定新系列时,旧系列将被断开连接(但其数据仍会被保留)。
xColumn : int
模型中包含数据点 x 坐标的列。默认值为 -1(映射无效)。
yColumn : int
模型中包含数据点 y 坐标的列。默认值为 -1(映射无效)。
© 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.