PySide6.QtGraphs.QScatterDataProxy

class QScatterDataProxy

QScatterDataProxy 类是用于3D散点图的数据代理。更多

PySide6.QtGraphs.QScatterDataProxy 的继承图

继承自: QItemModelScatterDataProxy

概要

属性

方法

信号

注意

本文档可能包含从C++自动翻译到Python的代码片段。我们始终欢迎对代码片段翻译的贡献。如果您发现翻译问题,您也可以通过在我们的https:/bugreports.qt.io/projects/PYSIDE上创建工单来告知我们。

详细描述

散点数据代理处理添加、插入、更改和删除数据项。由于数据存储在系列中,因此在使用这些函数处理数据集之前,需要创建一个与代理关联的系列。

QScatterDataProxy 拥有所有传递给它的 QtGraphs::QScatterDataArray 和 QScatterDataItem 对象的所有权。

另请参阅

使用3D处理Qt图形数据

注意

当使用from __feature__ import true_property时,属性可以直接使用,否则通过访问器函数使用。

property itemCountᅟ: int

此属性保存数组中的项目数量。

Access functions:
property seriesᅟ: QScatter3DSeries

此属性保存此代理附加到的系列。

Access functions:
__init__([parent=None])
Parameters:

父对象QObject

使用给定的parent构造QScatterDataProxy

addItem(item)
Parameters:

项目QScatterDataItem

Return type:

整数

将项目 item 添加到数组的末尾。

返回添加项的索引。

addItems(items)
Parameters:

items – QScatterDataItem 的列表

Return type:

整数

items指定的项目添加到数组的末尾。

返回第一个添加项的索引。

arrayReset()

当数据数组被重置时,会发出此信号。如果整个数组的内容在没有调用resetArray()的情况下被更改,则需要发出此信号以更新图表。

insertItem(index, item)
Parameters:

将项目 item 插入到位置 index。如果索引等于数据数组的大小,则将项目添加到数组中。

insertItems(index, items)
Parameters:
  • index – 整数

  • items – QScatterDataItem 的列表

items指定的项目插入到位置index。如果索引等于数据数组的大小,则将项目添加到数组中。

itemAt(index)
Parameters:

索引 – int

Return type:

QScatterDataItem

返回指向索引index处项目的指针。保证仅在下次修改数据的调用之前有效。

itemCount()
Return type:

整数

属性 itemCountᅟ 的获取器。

itemCountChanged(count)
Parameters:

count – int

属性 itemCountᅟ 的通知信号。

itemsAdded(startIndex, count)
Parameters:
  • startIndex – int

  • count – int

当从位置 startIndex 开始添加由 count 指定的项目数量时,会发出此信号。如果项目被添加到数组中而没有调用 addItem()addItems(),则需要发出此信号以更新图表。

itemsChanged(startIndex, count)
Parameters:
  • startIndex – int

  • count – int

当从位置 startIndex 开始,由 count 指定的项目数量发生变化时,会发出此信号。如果在数组中更改了项目而没有调用 setItem()setItems(),则需要发出此信号以更新图表。

itemsInserted(startIndex, count)
Parameters:
  • startIndex – int

  • count – int

当从位置 startIndex 开始插入由 count 指定的项目数量时,会发出此信号。如果项目被插入到数组中而没有调用 insertItem()insertItems(),则需要发出此信号以更新图表。

itemsRemoved(startIndex, count)
Parameters:
  • startIndex – int

  • count – int

当从位置 startIndex 开始移除由 count 指定的行数时,会发出此信号。如果从末尾移除项目,索引可能大于当前数组大小。如果从数组中移除项目而不调用 removeItems(),则需要发出此信号以更新图表。

removeItems(index, removeCount)
Parameters:
  • index – 整数

  • removeCount – int

从位置 index 开始,移除由 removeCount 指定的项目数量。尝试移除超出数组末尾的项目不会产生任何效果。

resetArray()

清除现有数组并触发arrayReset()信号。

resetArray(newArray)
Parameters:

newArray – QScatterDataItem 的列表

newArray设置数组。如果新数组与现有数组相同,此函数仅触发arrayReset()信号。

series()
Return type:

QScatter3DSeries

属性 seriesᅟ 的获取器。

seriesChanged(series)
Parameters:

seriesQScatter3DSeries

属性 seriesᅟ 的通知信号。

setItem(index, item)
Parameters:

用项目 item 替换位置 index 处的项目。

setItems(index, items)
Parameters:
  • index – 整数

  • items – QScatterDataItem 的列表

从位置 index 开始,用 items 指定的项目替换项目。