- Qt 6.11
- Qt Graphs
- C++ Classes
- QtGraphs
- QScatterDataProxy
- Qt Graphs | Commercial or GPLv3

# QScatterDataProxy Class

The QScatterDataProxy class is the data proxy for 3D scatter graphs. More...

Header: | `#include <QScatterDataProxy>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS Graphs)` `target_link_libraries(mytarget PRIVATE Qt6::Graphs)`
qmake: | `QT += graphs`
In QML: | ScatterDataProxy
Inherits: | QAbstractDataProxy
Inherited By: | QItemModelScatterDataProxy

- List of all members, including inherited members
- QScatterDataProxy is part of Qt Graphs C++ Classes for 3D.

## Properties

- itemCount : qsizetype
- series : QScatter3DSeries*

## Public Functions

| QScatterDataProxy(QObject *parent = nullptr)
virtual | ~QScatterDataProxy() override
qsizetype | addItem(QScatterDataItem item)
qsizetype | addItems(QScatterDataArray items)
void | insertItem(qsizetype index, QScatterDataItem item)
void | insertItems(qsizetype index, QScatterDataArray items)
const QScatterDataItem & | itemAt(qsizetype index) const
qsizetype | itemCount() const
void | removeItems(qsizetype index, qsizetype removeCount)
void | resetArray()
void | resetArray(QScatterDataArray newArray)
void | resetScaleArray(QList<QVector3D> newArray)
QVector3D | scaleAt(qsizetype index) const
QScatter3DSeries * | series() const
void | setItem(qsizetype index, QScatterDataItem item)
void | setItems(qsizetype index, QScatterDataArray items)

## Signals

void | arrayReset()
void | itemCountChanged(qsizetype count)
void | itemsAdded(qsizetype startIndex, qsizetype count)
void | itemsChanged(qsizetype startIndex, qsizetype count)
void | itemsInserted(qsizetype startIndex, qsizetype count)
void | itemsRemoved(qsizetype startIndex, qsizetype count)
void | seriesChanged(QScatter3DSeries *series)

## Related Non-Members

| QScatterDataArray

## Detailed Description

A scatter data proxy handles adding, inserting, changing, and removing data items. Since data is stored in series, it is necessary to create a series associated with the proxy before using these functions for the dataset.

QScatterDataProxy takes ownership of all QtGraphs::QScatterDataArray and QScatterDataItem objects passed to it.

See also Qt Graphs Data Handling with 3D.

## Property Documentation

### `[read-only]` itemCount : qsizetype

This property holds the number of items in the array.

Access functions:

qsizetype | itemCount() const

Notifier signal:

void | itemCountChanged(qsizetype count)

### `[read-only]` series : QScatter3DSeries*

This property holds the series this proxy is attached to.

Access functions:

QScatter3DSeries * | series() const

Notifier signal:

void | seriesChanged(QScatter3DSeries *series)

## Member Function Documentation

### `[explicit]` QScatterDataProxy::QScatterDataProxy(QObject *parent = nullptr)

Constructs QScatterDataProxy with the given parent.

### `[override virtual noexcept]` QScatterDataProxy::~QScatterDataProxy()

Deletes the scatter data proxy.

### qsizetype QScatterDataProxy::addItem(QScatterDataItem item)

Adds the item item to the end of the array.

Returns the index of the added item.

### qsizetype QScatterDataProxy::addItems(QScatterDataArray items)

Adds the items specified by items to the end of the array.

Returns the index of the first added item.

### `[signal]` void QScatterDataProxy::arrayReset()

This signal is emitted when the data array is reset. If the contents of the whole array are changed without calling resetArray(), this signal needs to be emitted to update the graph.

### void QScatterDataProxy::insertItem(qsizetype index, QScatterDataItem item)

Inserts the item item to the position index. If the index is equal to the data array size, the item is added to the array.

### void QScatterDataProxy::insertItems(qsizetype index, QScatterDataArray items)

Inserts the items specified by items to the position index. If the index is equal to data array size, the items are added to the array.

### const QScatterDataItem &QScatterDataProxy::itemAt(qsizetype index) const

Returns the pointer to the item at the index index. It is guaranteed to be valid only until the next call that modifies data.

### `[signal]` void QScatterDataProxy::itemsAdded(qsizetype startIndex, qsizetype count)

This signal is emitted when the number of items specified by count are added, starting at the position startIndex. If items are added to the array without calling addItem() or addItems(), this signal needs to be emitted to update the graph.

### `[signal]` void QScatterDataProxy::itemsChanged(qsizetype startIndex, qsizetype count)

This signal is emitted when the number of items specified by count are changed, starting at the position startIndex. If items are changed in the array without calling setItem() or setItems(), this signal needs to be emitted to update the graph.

### `[signal]` void QScatterDataProxy::itemsInserted(qsizetype startIndex, qsizetype count)

This signal is emitted when the number of items specified by count are inserted, starting at the position startIndex. If items are inserted into the array without calling insertItem() or insertItems(), this signal needs to be emitted to update the graph.

### `[signal]` void QScatterDataProxy::itemsRemoved(qsizetype startIndex, qsizetype count)

This signal is emitted when the number of rows specified by count are removed, starting at the position startIndex. The index may be larger than the current array size if items are removed from the end. If items are removed from the array without calling removeItems(), this signal needs to be emitted to update the graph.

### void QScatterDataProxy::removeItems(qsizetype index, qsizetype removeCount)

Removes the number of items specified by removeCount starting at the position index. Attempting to remove items past the end of the array does nothing.

### void QScatterDataProxy::resetArray()

Clears the existing array and triggers the arrayReset() signal.

### void QScatterDataProxy::resetArray(QScatterDataArray newArray)

Sets the array from newArray. If the new array is equal to the existing one, this function simply triggers the arrayReset() signal.

### void QScatterDataProxy::resetScaleArray(QList<QVector3D> newArray)

Sets the scale array from newArray. If the new array is equal to the existing one, this function simply triggers the scaleArrayReset() signal.

### QVector3D QScatterDataProxy::scaleAt(qsizetype index) const

Returns the scale data at the index index. It is guaranteed to be valid only until the next call that modifies data.

### void QScatterDataProxy::setItem(qsizetype index, QScatterDataItem item)

Replaces the item at the position index with the item item.

### void QScatterDataProxy::setItems(qsizetype index, QScatterDataArray items)

Replaces the items starting from the position index with the items specified by items.

## Related Non-Members

### `[alias]` QScatterDataArray

A list of QScatterDataItem objects.