VBoxPlotModelMapper QML Type
用于箱线图系列的垂直模型映射器。更多...
| Import Statement: | import QtCharts 2.12 |
| In C++: | QVBoxPlotModelMapper |
| Status: | Deprecated |
此类型已弃用。我们强烈建议不要在新代码中使用它。
属性
- firstBoxSetColumn : int
- firstRow : int
- lastBoxSetColumn : int
- model : SomeModel
- rowCount : int
- series : AbstractBarSeries
详细说明
VBoxPlotModelMapper 类型允许将从QAbstractItemModel 类派生出的数据模型用作图表的数据源。 垂直模型映射器用于在数据模型与BoxPlotSeries 类型之间建立关联,使得数据模型中的每一列都定义一个箱线图项目,每一行则映射到该箱线图项目的范围及其三个中位数值。
既可以使用模型属性,也可以使用系列属性来操作数据。模型映射器会保持系列与数据模型之间的同步。
模型映射器可确保箱线图系列中所有条形箱线图项的大小一致。因此,向某个箱线图项添加或移除一个值,会导致箱线图系列中的所有箱线图项发生相同的变更。
以下 QML 代码片段创建了一个包含三个箱线图项的箱线图序列(假设模型至少有四列)。每个箱线图项包含从第 1 行开始的数据。项的名称由列标题定义。
BoxPlotSeries {
VBoxPlotModelMapper {
model: myCustomModel // QAbstractItemModel derived implementation
firstBoxSetColumn: 1
lastBoxSetColumn: 3
firstRow: 1
}
}另请参阅 HBoxPlotModelMapper 。
属性文档
firstBoxSetColumn : int
用作第一个箱线图项目数据源的模型列。默认值为 -1(映射无效)。
firstRow : int
模型中包含箱线图系列中各项目首个值的行。
默认值为 0。
lastBoxSetColumn : int
用作最后一个箱线图项数据源的模型列。默认值为 -1(映射无效)。
model : SomeModel
映射器所使用的数据模型。您需要实现该模型并将其暴露给 QML。
注意:该 模型必须支持添加和删除行或列,以及修改单元格中的数据。
rowCount : int
模型中作为箱线图系列数据映射的行数。
默认值为 -1(该数值上限为模型的列数)。
series : AbstractBarSeries
映射器所使用的箱线图系列。
将该系列设置到映射器时,其中的所有数据都会被丢弃。当指定新系列时,旧系列将被断开连接(但其数据仍会被保留)。
© 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.