ItemModelSurfaceDataProxy QML Type
用于在项目模型中通过Surface3D 呈现数据的代理类。更多内容...
| Import Statement: | import QtDataVisualization 1.12 |
| Since: | QtDataVisualization 1.0 |
| In C++: | QItemModelSurfaceDataProxy |
| Inherits: | |
| Status: | Deprecated |
此类型已弃用。我们强烈建议不要在新代码中使用它。
属性
- autoColumnCategories : bool
- autoRowCategories : bool
- columnCategories : list<String>
- columnRole : string
- columnRolePattern : regExp
- columnRoleReplace : string
- itemModel : model
- multiMatchBehavior : ItemModelSurfaceDataProxy.MultiMatchBehavior
- rowCategories : list<String>
- rowRole : string
- rowRolePattern : regExp
- rowRoleReplace : string
- useModelCategories : bool
- xPosRole : string
- xPosRolePattern : regExp
- xPosRoleReplace : string
- yPosRole : string
- yPosRolePattern : regExp
- yPosRoleReplace : string
- zPosRole : string
- zPosRolePattern : regExp
- zPosRoleReplace : string
详细说明
此类允许您将AbstractItemModel 的派生模型用作Surface3D 的数据源。
每当映射或模型发生更改时,系统都会异步解析数据。
有关 ItemModelSurfaceDataProxy 枚举,请参阅QItemModelSurfaceDataProxy::MultiMatchBehavior 。
有关更多详细信息,请参阅QItemModelSurfaceDataProxy 文档。
使用示例:
ItemModelSurfaceDataProxy {
itemModel: model // E.g. a list model defined elsewhere containing population data.
// Mapping model roles to surface series rows, columns, and values.
rowRole: "longitude"
columnRole: "latitude"
valueRole: "pop_density"
}另请参阅 SurfaceDataProxy 以及Qt Data Visualization 中的“数据处理”部分。
属性文档
autoColumnCategories : bool
当设置为“true ”时,映射会忽略任何显式设置的列类别,并在每次解析模型数据时,用自动生成的列类别覆盖它们。当设置为“true ”时,代理列的最小值和最大值也会根据数据自动生成。默认值为“true ”。
autoRowCategories : bool
当设置为true 时,映射将忽略任何显式设置的行类别,并在每次解析模型数据时用自动生成的类别覆盖它们。当设置为true 时,代理的最小和最大行值也会根据数据自动生成。默认值为true 。
columnCategories : list<String>
映射的列类别。在解析数据时,仅包含列角色出现在此列表中的项目。列的排序顺序与该列表中的顺序一致。
columnRole : string
用于将项目模型角色映射到列类别的角色。除了定义数据所属的列之外,当解析模型数据时,列角色所指示的值还会被设置为 QSurfaceDataItem 的 X 坐标值,除非还单独定义了 X 位置角色。
columnRolePattern : regExp
启用此属性后,在将列角色映射的值用作列类别之前,会对其执行搜索和替换操作。该属性指定用于查找映射值中待替换部分的正则表达式,而columnRoleReplace 属性则包含替换字符串。
另请参阅 columnRole 和columnRoleReplace 。
columnRoleReplace : string
该替换内容需与 `columnRolePattern` 配合使用。默认值为空字符串。有关使用正则表达式进行搜索和替换的更多信息,请参阅 `QString::replace(constQRegularExpression &rx, constQString &after)` 函数的文档。
另请参阅 columnRole 和columnRolePattern 。
itemModel : model
用作 Surface3D 数据源的项模型。
multiMatchBehavior : ItemModelSurfaceDataProxy.MultiMatchBehavior
定义了如何处理每行/列组合中的多个匹配项。默认值为ItemModelSurfaceDataProxy.MMBLast 。
例如,假设您有一个包含不规则间隔采集的带时间戳数据的项模型,并希望使用曲面图可视化每小时数据项的平均位置。可以通过指定行和列类别(使每个曲面点代表一个小时),并将 multiMatchBehavior 设置为ItemModelSurfaceDataProxy.MMBAverage 来实现。
rowCategories : list<String>
映射的行类别。在解析数据时,仅包含行角色出现在此列表中的项目。行的排序顺序与该列表中的顺序一致。
rowRole : string
用于映射到行类别的项模型角色。除了定义数据所属的行之外,当解析模型数据时,行角色所指示的值还会被设置为 QSurfaceDataItem 的 Z 坐标值,除非还定义了单独的 z 位置角色。
rowRolePattern : regExp
启用此属性后,在将行角色映射的值用作行类别之前,会对其进行搜索和替换操作。该属性指定用于查找映射值中待替换部分的正则表达式,而rowRoleReplace 属性则包含替换字符串。
另请参阅 rowRole 和rowRoleReplace 。
rowRoleReplace : string
该替换内容需与 `rowRolePattern` 配合使用。默认值为空字符串。有关使用正则表达式进行搜索和替换的更多信息,请参阅函数 `QString::replace(constQRegularExpression &rx, constQString &after)` 的文档。
另请参阅 rowRole 和rowRolePattern 。
useModelCategories : bool
当设置为true 时,映射将忽略行和列的角色及类别,而是使用模型中的行和列。默认值为false 。
xPosRole : string
用于映射到 X 位置的项目模型角色。如果未定义此角色,则使用columnRole 来确定已解析的QSurfaceDataItem 项目的 X 坐标值。
xPosRolePattern : regExp
设置此属性后,在将由“x 位置”角色映射出的值用作项目位置值之前,会对其进行搜索和替换操作。该属性指定用于查找映射值中待替换部分的正则表达式,而“xPosRoleReplace ”属性则包含替换字符串。
另请参阅 xPosRole 和xPosRoleReplace 。
xPosRoleReplace : string
该替换内容需与 `xPosRolePattern` 配合使用。默认值为空字符串。有关使用正则表达式进行搜索和替换的详细信息,请参阅 `QString::replace(constQRegularExpression &rx, constQString &after)` 函数的文档。
另请参阅 xPosRole 和xPosRolePattern 。
yPosRole : string
用于映射到 Y 位置的项模型角色。
yPosRolePattern : regExp
设置此属性后,在将由 y 位置角色映射的值用作项目位置值之前,会对该值进行搜索和替换操作。该属性指定用于查找映射值中待替换部分的正则表达式,而yPosRoleReplace 属性则包含替换字符串。
另请参阅 yPosRole 和yPosRoleReplace 。
yPosRoleReplace : string
该替换内容需与yPosRolePattern 配合使用。默认值为空字符串。有关使用正则表达式进行搜索和替换的更多信息,请参阅QString::replace (constQRegularExpression &rx, constQString &after)函数的文档。
另请参阅 yPosRole 和yPosRolePattern 。
zPosRole : string
用于映射到 Z 位置的项模型角色。如果未定义此角色,则使用“rowRole ”来确定已解析的“QSurfaceDataItem ”项的 Z 坐标值。
zPosRolePattern : regExp
设置此属性后,在将由“z 位置”角色映射的值用作项目位置值之前,会对其进行搜索和替换操作。该属性指定用于查找映射值中待替换部分的正则表达式,而“zPosRoleReplace ”属性则包含替换字符串。
另请参阅 zPosRole 和zPosRoleReplace 。
zPosRoleReplace : string
该替换内容需与 `zPosRolePattern` 配合使用。默认值为空字符串。有关使用正则表达式进行搜索和替换的更多信息,请参阅 `QString::replace(constQRegularExpression &rx, constQString &after)` 函数的文档。
另请参阅 zPosRole 和zPosRolePattern 。
© 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.