ItemModelSurfaceDataProxy QML Type

代理类,用于在Surface3D 项目模型中显示数据。更多

Import Statement: import QtDataVisualization 1.9
Since: QtDataVisualization 1.0
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"
}

另请参阅 SurfaceDataProxyQt Data Visualization 数据处理

属性文档

autoColumnCategories : bool

当设置为true 时,映射会忽略任何显式设置的列类别,并在解析模型数据时用自动生成的列类别覆盖它们。设置为true 时,也会根据数据自动生成代理最小和最大列值。默认为true


autoRowCategories : bool

当设置为true 时,映射会忽略任何显式设置的行类别,并在解析模型数据时用自动生成的类别覆盖它们。当设置为true 时,也会根据数据自动生成代理最小和最大行值。默认为true


columnCategories : list<String>

映射的列类别。解析数据时,只包含在此列表中具有列角色的项目。列的顺序与此列表中的顺序相同。


columnRole : string

要映射到列类别的项目模型角色。除了定义数据属于哪一列外,列角色指示的值还会在解析模型数据时设置为QSurfaceDataItem 的 X 坐标值,除非还定义了单独的 X 位置角色。


columnRolePattern : regExp

设置后,在将列角色映射的值用作列类别之前,会对其进行搜索和替换。该属性指定了正则表达式,用于查找要替换的映射值部分,而columnRoleReplace 属性则包含替换字符串。

另请参阅 columnRolecolumnRoleReplace


columnRoleReplace : string

替换内容与columnRolePattern 一起使用。默认为空字符串。有关如何使用正则表达式进行搜索和替换的详细信息,请参阅QString::replace(constQRegularExpression &rx, constQString &after) 函数文档。

另请参阅 columnRolecolumnRolePattern


itemModel : model

用作Surface3D 数据源的项目模型。


multiMatchBehavior : ItemModelSurfaceDataProxy.MultiMatchBehavior

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

例如,您可能有一个带有时间戳数据的项目模型,这些数据以不规则的时间间隔采集,您希望用曲面图直观显示数据项在每个小时的平均位置。为此,您可以指定行和列的类别,使每个曲面点代表一个小时,并将 multiMatchBehavior 设置为ItemModelSurfaceDataProxy.MMBAverage


rowCategories : list<String>

映射的行类别。在解析数据时,只包含此列表中具有行角色的项目。行的顺序与此列表中的顺序相同。


rowRole : string

要映射到行类别的项目模型角色。除了定义数据属于哪一行外,行角色指示的值还会在解析模型数据时设置为QSurfaceDataItem 的 Z 坐标值,除非还定义了单独的 Z 位置角色。


rowRolePattern : regExp

设置后,将对行角色映射的值进行搜索和替换,然后再将其用作行类别。该属性指定了正则表达式,用于查找要替换的映射值部分,而rowRoleReplace 属性则包含替换字符串。

另请参阅 rowRolerowRoleReplace


rowRoleReplace : string

替换内容与rowRolePattern 一起使用。默认为空字符串。有关如何使用正则表达式进行搜索和替换的详细信息,请参阅QString::replace(constQRegularExpression &rx, constQString &after) 函数文档。

另请参阅 rowRolerowRolePattern


useModelCategories : bool

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


xPosRole : string

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


xPosRolePattern : regExp

设置后,将对 x 位置角色映射的值进行搜索和替换,然后再将其用作项目位置值。该属性指定了正则表达式,用于查找要替换的映射值部分,而xPosRoleReplace 属性则包含替换字符串。

另请参阅 xPosRolexPosRoleReplace


xPosRoleReplace : string

替换内容与xPosRolePattern 一起使用。默认为空字符串。有关如何使用正则表达式进行搜索和替换的详细信息,请参阅QString::replace(constQRegularExpression &rx, constQString &after) 函数文档。

另请参阅 xPosRolexPosRolePattern


yPosRole : string

映射到 Y 位置的项目模型角色。


yPosRolePattern : regExp

设置后,将对 Y 位置角色映射的值进行搜索和替换,然后再将其用作项目位置值。该属性指定正则表达式,用于查找要替换的映射值部分,而yPosRoleReplace 属性包含替换字符串。

另请参阅 yPosRoleyPosRoleReplace


yPosRoleReplace : string

替换内容与yPosRolePattern 一起使用。默认为空字符串。有关如何使用正则表达式进行搜索和替换的详细信息,请参阅QString::replace(constQRegularExpression &rx, constQString &after) 函数文档。

另请参阅 yPosRoleyPosRolePattern


zPosRole : string

要映射到 Z 位置的项目模型角色。如果未定义该角色,则rowRole 用于确定已解析的QSurfaceDataItem 项目的 Z 坐标值。


zPosRolePattern : regExp

设置后,将对 z 位置角色映射的值进行搜索和替换,然后再将其用作项目位置值。该属性指定了正则表达式,用于查找要替换的映射值部分,而zPosRoleReplace 属性则包含替换字符串。

另请参阅 zPosRolezPosRoleReplace


zPosRoleReplace : string

替换内容与zPosRolePattern 一起使用。默认为空字符串。有关如何使用正则表达式进行搜索和替换的详细信息,请参阅QString::replace(constQRegularExpression &rx, constQString &after) 函数文档。

另请参阅 zPosRolezPosRolePattern


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