本页内容

ItemModelSurfaceDataProxy QML Type

用于通过Surface3D 在项模型中呈现数据的代理类。更多内容...

Import Statement: import QtGraphs
In C++: QItemModelSurfaceDataProxy
Inherits:

SurfaceDataProxy

属性

信号

详细说明

此类允许您将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 Graphs 中的“3D 数据处理”。

属性文档

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 : enumeration

定义了如何处理每行/列组合中的多个匹配项。默认值为ItemModelSurfaceDataProxy.MultiMatchBehavior.Last 。

例如,假设您有一个包含不规则间隔采集的带时间戳数据的项目模型,并希望使用曲面图可视化每个小时数据项的平均位置。可以通过指定行和列类别来实现这一点,使得每个曲面点代表一个小时,并将 multiMatchBehavior 设置为ItemModelSurfaceDataProxy.MultiMatchBehavior.Average 。

rowCategories : list<String>

映射的行类别。在解析数据时,仅包含行角色出现在此列表中的项目。行的排序顺序与该列表中的顺序一致。

rowRole : string

用于映射到行类别的项模型角色。除了定义数据所属的行之外,当模型数据被解析时,行角色所指示的值还会被设置为QSurfaceDataItem 的Z坐标值,除非还定义了单独的z位置角色。

rowRolePattern : regExp

启用此属性后,在将行角色映射的值用作行类别之前,系统会对其进行搜索和替换操作。该属性指定用于查找映射值中待替换部分的正则表达式,而rowRoleReplace 属性则包含替换字符串。

另请参阅 rowRole 和rowRoleReplace 。

rowRoleReplace : string

与rowRolePattern 配合使用的替换内容。默认值为空字符串。有关使用正则表达式进行搜索和替换的工作原理的更多信息,请参阅QString::replace(constQRegularExpression &rx, constQString &after) 函数的文档。

另请参阅 rowRole 和rowRolePattern 。

type : AbstractDataProxy.DataType [read-only]

代理的类型。QAbstractDataProxy::DataType 中的某个值。

useModelCategories : bool

当设置为true 时,映射将忽略行和列的角色及类别,转而使用模型中的行和列。默认值为false 。

xPosRole : string

用于映射到 X 位置的项目模型角色。如果未定义此角色,则使用“columnRole ”来确定解析后的QSurfaceDataItem 项目的 X 坐标值。

xPosRolePattern : regExp

设置此属性后,在将由 x-position 角色映射的值用作项目位置值之前,会对其进行搜索和替换操作。该属性指定用于查找映射值中待替换部分的正则表达式,而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-position 角色映射的值用作项目位置值之前,会对其进行搜索和替换操作。该属性指定用于查找映射值中待替换部分的正则表达式,而zPosRoleReplace 属性则包含替换字符串。

另请参阅 zPosRole 和zPosRoleReplace 。

zPosRoleReplace : string

与zPosRolePattern 配合使用的替换内容。默认值为空字符串。有关使用正则表达式进行搜索和替换的工作原理的更多信息,请参阅QString::replace(constQRegularExpression &rx, constQString &after) 函数的文档。

另请参阅 zPosRole 和zPosRolePattern 。

信号文档

autoColumnCategoriesChanged(bool enable)

当autoColumnCategories 变为enable 时,会触发此信号。

注意: 相应的处理程序 为onAutoColumnCategoriesChanged 。

autoRowCategoriesChanged(bool enable)

当autoRowCategories 变为enable 时,会触发此信号。

注意: 相应的处理程序 为onAutoRowCategoriesChanged 。

columnCategoriesChanged()

当columnCategories 发生变化时,会触发此信号。

注意: 相应的处理程序 是onColumnCategoriesChanged 。

columnRoleChanged(string role)

当columnRole 变为role 时,会触发此信号。

注意: 对应的处理程序 是onColumnRoleChanged 。

columnRolePatternChanged(regExp pattern)

当columnRolePattern 变为pattern 时,会触发此信号。

注意: 相应的处理程序 是onColumnRolePatternChanged 。

columnRoleReplaceChanged(string replace)

当columnRoleReplace 变为replace 时,会触发此信号。

注意: 相应的处理程序 是onColumnRoleReplaceChanged 。

itemModelChanged(model itemModel)

当itemModel 变为itemModel 时,会触发此信号。

注意: 相应的处理程序 是onItemModelChanged 。

multiMatchBehaviorChanged(enumeration behavior)

当multiMatchBehavior 变为behavior 时,会触发此信号。

注意: 相应的处理程序 是onMultiMatchBehaviorChanged 。

rowCategoriesChanged()

当rowCategories 发生变化时,会触发此信号。

注意: 相应的处理程序 是onRowCategoriesChanged 。

rowRoleChanged(string role)

当rowRole 变为role 时,会触发此信号。

注意: 相应的处理程序 是onRowRoleChanged 。

rowRolePatternChanged(regExp pattern)

当rowRolePattern 变为pattern 时,会发出此信号。

注意: 对应的处理程序 是onRowRolePatternChanged 。

rowRoleReplaceChanged(string replace)

当rowRoleReplace 变为replace 时,会触发此信号。

注意: 相应的处理程序 是onRowRoleReplaceChanged 。

useModelCategoriesChanged(bool enable)

当useModelCategories 变为enable 时,会触发此信号。

注意: 相应的处理程序 是onUseModelCategoriesChanged 。

xPosRoleChanged(string role)

当xPosRole 变为role 时,会触发此信号。

注意: 相应的处理程序 为onXPosRoleChanged 。

xPosRolePatternChanged(regExp pattern)

当xPosRolePattern 变为pattern 时,会触发此信号。

注意: 相应的处理程序 是onXPosRolePatternChanged 。

xPosRoleReplaceChanged(string replace)

当xPosRoleReplace 变为replace 时,会触发此信号。

注意: 相应的处理程序 为onXPosRoleReplaceChanged 。

yPosRoleChanged(string role)

当yPosRole 变为role 时,会触发此信号。

注意: 相应的处理程序 是onYPosRoleChanged 。

yPosRolePatternChanged(regExp pattern)

当yPosRolePattern 变为pattern 时,会触发此信号。

注意: 相应的处理程序 是onYPosRolePatternChanged 。

yPosRoleReplaceChanged(string replace)

当yPosRoleReplace 变为replace 时,会发出此信号。

注意: 相应的处理程序 是onYPosRoleReplaceChanged 。

zPosRoleChanged(string role)

当zPosRole 变为role 时,会发出此信号。

注意: 相应的处理程序 是onZPosRoleChanged 。

zPosRolePatternChanged(regExp pattern)

当zPosRolePattern 变为pattern 时,会触发此信号。

注意: 相应的处理程序 是onZPosRolePatternChanged 。

zPosRoleReplaceChanged(string replace)

当zPosRoleReplace 变为replace 时,会触发此信号。

注意: 相应的处理程序 是onZPosRoleReplaceChanged 。

© 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.