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"
}

另请参阅 SurfaceDataProxyQt Graphs 3D 数据处理

属性文档

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

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

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


rowCategories : list<String>

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


rowRole : string

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


rowRolePattern : regExp

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

另请参阅 rowRolerowRoleReplace


rowRoleReplace : string

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

另请参阅 rowRolerowRolePattern


type : AbstractDataProxy.DataType [read-only]

代理类型。QAbstractDataProxy::DataType 值之一。


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


信号文档

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


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