VCandlestickModelMapper QML Type
烛台系列的垂直模型映射器。更多
Import Statement: | import QtCharts 2.9 |
Since: | QtCharts 2.2 |
In C++: | QVCandlestickModelMapper |
属性
- closeRow : int
- firstSetColumn : int
- highRow : int
- lastSetColumn : int
- lowRow : int
- model : QAbstractItemModel
- openRow : int
- series : CandlestickSeries
- timestampRow : int
详细说明
模型映射器可将源自QAbstractItemModel 类的数据模型用作图表的数据源。垂直模型映射器用于在数据模型和CandlestickSeries 之间创建连接,这样数据模型中的每一列都定义了一个蜡烛图项目,而每一行都映射到蜡烛图项目的开盘、最高、最低、收盘和时间戳值。
模型和烛台系列属性都可用于操作数据。模型映射器使烛台系列和数据模型保持同步。
模型映射器可确保烛台系列中的所有烛台项目大小相等。因此,从烛台项目中添加或删除一个值会导致烛台系列中的所有烛台项目发生相同的变化。
下面的 QML 示例创建了一个有三个烛台项的烛台系列(假设模型至少有四列)。每个烛台项都包含由时间戳、开盘、高点、低点和收盘行定义的数据。项目名称由列的水平标题定义。
CandlestickSeries { VCandlestickModelMapper { model: myCustomModel // QAbstractItemModel derived implementation timestampRow: 1 openRow: 2 highRow: 3 lowRow: 4 closeRow: 5 firstSetColumn: 1 lastSetColumn: 3 } }
另请参阅 CandlestickSeries,CandlestickSet, 和HCandlestickModelMapper 。
属性文档
closeRow : int |
模型中包含系列中蜡烛图项目收盘值的行。默认值为-1(无效映射)。
firstSetColumn : int |
模型中用作第一个项目数据源的列。默认值为-1(映射无效)。
highRow : int |
模型中包含系列中蜡烛图项目最高值的行。默认值为-1(映射无效)。
lastSetColumn : int |
模型中用作最后一个项目数据源的列。默认值为-1(映射无效)。
lowRow : int |
模型中包含系列中蜡烛图项目低值的行。默认值为-1(映射无效)。
model : QAbstractItemModel |
映射器使用的基于QAbstractItemModel 的模型。该模型必须实现并暴露给 QML。
注意: 使用的模型必须支持添加和删除行或列,以及修改单元格的数据。
openRow : int |
模型中包含系列中蜡烛图项目开仓值的行。默认值为-1(无效映射)。
series : CandlestickSeries |
映射器使用的基于CandlestickSeries 的对象。
系列中的所有数据在设置给映射器时都会被丢弃。指定新系列时,旧系列将被断开(但保留其数据)。
timestampRow : int |
模型中包含系列中蜡烛图项目时间戳值的行。默认值为-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.