HXYModelMapper QML Type

用于XYSeries 的水平模型映射器。更多

Import Statement: import QtCharts 2.9
In C++: QHXYModelMapper

属性

详细说明

模型映射器可将源自QAbstractItemModel 类的数据模型用作图表的数据源。水平模型映射器用于在直线、样条线或散点图系列与数据模型之间建立连接,数据模型的XY行表示坐标,XYSeries 的数据点表示列。自然可以选择TableModel作为模型。

模型和序列属性都可用于操作数据。模型映射器可使系列和数据模型保持同步。

另请参阅 VXYModelMapper,XYSeries, 以及带 Widgets 图库的图表

属性文档

columnCount : int

映射为系列数据的模型列数。默认值为-1(该值受模型列数的限制)。


firstColumn : int

模型中包含序列第一点数据的列。默认值为 0。


model : SomeModel

映射器使用的数据模型。您需要实现该模型并将其暴露给 QML。

注意: 模型必须支持添加和删除行或列,以及修改单元格中的数据。


series : XYSeries

映射器使用的系列。当向映射器设置系列时,系列中的所有数据都会被丢弃。指定新系列时,旧系列将被断开(但保留其数据)。


xRow : int

模型中包含数据点 x 坐标的行。默认值为-1(无效映射)。


yRow : int

模型中包含数据点 y 坐标的行。

默认值为-1(映射无效)。


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