VXYModelMapper QML Type

A vertical model mapper for XYSeries . 更多...

import 语句: import QtCharts 2.2
实例化: QVXYModelMapper

特性

详细描述

模型映射器允许使用的数据模型派生自 QAbstractItemModel class as a data source for a chart. A vertical model mapper is used to create a connection between a line, spline, or scatter series and the data model that has X and Y columns for the coordinates and holds the data points for the XYSeries as rows. A TableModel is a natural choice for the model.

Both model and series properties can be used to manipulate the data. The model mapper keeps the series and the data model in sync.

另请参阅 HXYModelMapper , XYSeries ,和 模型数据范例 .

特性文档编制

firstRow : int

The row of the model that contains the data for the first point of the series. The default value is 0.

model : SomeModel

The data model that is used by the mapper. You need to implement the model and expose it to QML.

注意: The model has to support adding and removing rows or columns and modifying the data in the cells.

rowCount : int

The number of rows of the model that are mapped as the data for series. The default value is -1 (the number is limited by the number of rows in the model).

series : XYSeries

The series that is used by the mapper. All the data in the series is discarded when it is set to the mapper. When a new series is specified, the old series is disconnected (but it preserves its data).

xColumn : int

The column of the model that contains the x-coordinates of data points. The default value is -1 (invalid mapping).

yColumn : int

The column of the model that contains the y-coordinates of data points. The default value is -1 (invalid mapping).