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