VCandlestickModelMapper QML Type
用于K线序列的垂直模型映射器。更多...
| Import Statement: | import QtCharts 2.12 |
| Since: | QtCharts 2.2 |
| In C++: | QVCandlestickModelMapper |
| Status: | Deprecated |
此类型已弃用。我们强烈建议不要在新代码中使用它。
属性
- closeRow : int
- firstSetColumn : int
- highRow : int
- lastSetColumn : int
- lowRow : int
- model : QAbstractItemModel
- openRow : int
- series : CandlestickSeries
- timestampRow : int
详细说明
模型映射器允许将从QAbstractItemModel 类派生的数据模型用作图表的数据源。 垂直模型映射器用于在数据模型与CandlestickSeries 之间建立连接,使得数据模型中的每一列都定义一个K线项目,每一行则映射到该K线项目的开盘价、最高价、最低价、收盘价和时间戳值。
既可以使用模型属性,也可以使用 K 线系列属性来操作数据。模型映射器会保持 K 线系列与数据模型之间的同步。
模型映射器确保烛线序列中的所有烛线项大小一致。因此,向某个烛线项添加或移除一个值时,烛线序列中的所有烛线项都会发生相同的变更。
以下 QML 示例创建了一个包含三个 K 线项的 K 线序列(假设模型至少有四个列)。每个 K 线项包含由时间戳、开盘价、最高价、最低价和收盘价行定义的数据。项的名称由列的水平标题定义。
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
模型中包含该系列中K线项目收盘值的行。默认值为-1(无效映射)。
firstSetColumn : int
模型中用作第一个项的数据源的列。默认值为 -1(映射无效)。
highRow : int
模型中包含该序列中K线项目高值的行。默认值为-1(无效映射)。
lastSetColumn : int
模型中用作最后一个项目数据源的列。默认值为 -1(映射无效)。
lowRow : int
模型中包含该序列内K线项目低值的行。默认值为-1(无效映射)。
model : QAbstractItemModel
映射器所使用的基于QAbstractItemModel 的模型。该模型必须已实现并向QML公开。
注意: 所使用的模型 必须支持添加和删除行或列,以及修改单元格中的数据。
openRow : int
模型中包含该系列 K 线项目开盘值的行。默认值为 -1(映射无效)。
series : CandlestickSeries
映射器所使用的基于 CandlestickSeries 的对象。
当该系列被设置到映射器时,其中的所有数据都会被丢弃。当指定一个新系列时,旧系列将被断开连接(但其数据会被保留)。
timestampRow : int
模型中包含该序列中K线项时间戳值的行。默认值为-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.