ItemModelScatterDataProxy QML Type
| Import Statement: | import QtDataVisualization 1.11 |
| Since: | QtDataVisualization 1.0 |
| In C++: | QItemModelScatterDataProxy |
| Inherits: |
属性
- itemModel : model
- rotationRole : string
- rotationRolePattern : regExp
- rotationRoleReplace : string
- xPosRole : string
- xPosRolePattern : regExp
- xPosRoleReplace : string
- yPosRole : string
- yPosRolePattern : regExp
- yPosRoleReplace : string
- zPosRole : string
- zPosRolePattern : regExp
- zPosRoleReplace : string
详细描述
该类型允许您使用 AbstractItemModel 派生模型作为Scatter3D 的数据源。
每当映射或模型发生变化时,数据都会被异步解析。QScatterDataProxy::arrayReset(数据解析完成后,会发出()。
有关详细信息,请参阅QItemModelScatterDataProxy 文档。
使用示例:
ItemModelScatterDataProxy {
itemModel: model // E.g. a list model defined elsewhere containing point coordinates.
// Mapping model roles to scatter series item coordinates.
xPosRole: "xPos"
yPosRole: "yPos"
zPosRole: "zPos"
}另请参阅 ScatterDataProxy 和Qt Data Visualization 数据处理。
属性文档
itemModel : model
用作Scatter3D 数据源的项目模型。
rotationRole : string
映射到项目旋转的项目模型角色。模型提供的旋转值可以是直接转换为quaternion 的变量,也可以是字符串表示形式之一:"scalar,x,y,z" 或"@angle,x,y,z" 。第一种格式将用给定的值直接构造quaternion ,第二种格式将使用QQuaternion::fromAxisAndAngle() 方法构造quaternion 。
rotationRolePattern : regExp
设置后,将对旋转角色映射的值进行搜索和替换,然后再将其用作项目旋转。该属性指定了正则表达式,用于查找要替换的映射值部分,而rotationRoleReplace 属性则包含替换字符串。
另请参阅 rotationRole 和rotationRoleReplace 。
rotationRoleReplace : string
该属性定义了与rotationRolePattern 一起使用的替换内容。默认为空字符串。有关使用正则表达式进行搜索和替换的工作原理,请参阅QString::replace(constQRegularExpression &rx, constQString &after) 函数文档。
另请参阅 rotationRole 和rotationRolePattern 。
xPosRole : string
映射到 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 位置的项目模型角色。
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.