Auf dieser Seite

QAbstractItemModelReplica Class

Die Klasse „QAbstractItemModelReplica“ dient als Komfortklasse für Replikate von Quellen, die auf „ QAbstractItemModel “ basieren. Mehr dazu...

Header: #include <QAbstractItemModelReplica>
CMake: find_package(Qt6 REQUIRED COMPONENTS RemoteObjects)
target_link_libraries(mytarget PRIVATE Qt6::RemoteObjects)
qmake: QT += remoteobjects
Erbt von: QAbstractItemModel

Öffentliche Funktionen

virtual ~QAbstractItemModelReplica() override
QList<int> availableRoles() const
bool hasData(const QModelIndex &index, int role) const
bool isInitialized() const
size_t rootCacheSize() const
QItemSelectionModel *selectionModel() const
void setRootCacheSize(size_t rootCacheSize)

Neu implementierte öffentliche Funktionen

virtual int columnCount(const QModelIndex &parent = QModelIndex()) const override
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override
virtual Qt::ItemFlags flags(const QModelIndex &index) const override
virtual bool hasChildren(const QModelIndex &parent = QModelIndex()) const override
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const override
virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override
virtual void multiData(const QModelIndex &index, QModelRoleDataSpan roleDataSpan) const override
virtual QModelIndex parent(const QModelIndex &index) const override
virtual QHash<int, QByteArray> roleNames() const override
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override

Signale

void initialized()

Ausführliche Beschreibung

QAbstractItemModelReplica sorgt durch den Einsatz von Caching und Pre-Fetching für eine effizientere Replikation von QAbstractItemModels.

Siehe auch „ QAbstractItemModel “.

Dokumentation der Mitgliedsfunktionen

[override virtual noexcept] QAbstractItemModelReplica::~QAbstractItemModelReplica()

Löscht die Instanz von „ QAbstractItemModelReplica “.

QList<int> QAbstractItemModelReplica::availableRoles() const

Gibt eine Liste der verfügbaren Rollen zurück.

Siehe auch QAbstractItemModel.

[override virtual] int QAbstractItemModelReplica::columnCount(const QModelIndex &parent = QModelIndex()) const

Implementiert: ` QAbstractItemModel::columnCount(const QModelIndex &parent) const`.

[override virtual] QVariant QAbstractItemModelReplica::data(const QModelIndex &index, int role = Qt::DisplayRole) const

Implementiert: ` QAbstractItemModel::data(const QModelIndex &index, int role) const`.

Gibt die „ role “-Daten für das Element unter index zurück, sofern diese im Cache verfügbar sind. Ein standardmäßig konstruiertes „ QVariant “-Objekt wird zurückgegeben, wenn der Index ungültig ist, die Rolle nicht zu den verfügbaren Rollen gehört, das „Replica“-Objekt nicht initialisiert ist oder die Daten nicht verfügbar waren. Wenn die Daten nicht im Cache verfügbar waren, werden sie von der Quelle angefordert.

Siehe auch QAbstractItemModel::data(), hasData(), setData() und isInitialized().

[override virtual] Qt::ItemFlags QAbstractItemModelReplica::flags(const QModelIndex &index) const

Implementiert neu: ` QAbstractItemModel::flags(const QModelIndex &index) const`.

[override virtual] bool QAbstractItemModelReplica::hasChildren(const QModelIndex &parent = QModelIndex()) const

Implementiert: ` QAbstractItemModel::hasChildren(const QModelIndex &parent) const`.

bool QAbstractItemModelReplica::hasData(const QModelIndex &index, int role) const

Gibt „ true “ zurück, wenn für den Artikel unter index Daten im Format „ role “ vorhanden sind. In allen anderen Fällen wird „ false “ zurückgegeben.

[override virtual] QVariant QAbstractItemModelReplica::headerData(int section, Qt::Orientation orientation, int role) const

Implementiert: ` QAbstractItemModel::headerData(int section, Qt::Orientation orientation, int role) const`.

Gibt die Daten für das angegebene ` role ` und ` section ` aus dem Header mit der angegebenen ` orientation` zurück.

Sind die Daten nicht verfügbar, werden sie von der Quelle angefordert.

Siehe auch QAbstractItemModel::headerData().

[override virtual] QModelIndex QAbstractItemModelReplica::index(int row, int column, const QModelIndex &parent = QModelIndex()) const

Implementiert: ` QAbstractItemModel::index` (int row, int column, const QModelIndex &parent) const.

[signal] void QAbstractItemModelReplica::initialized()

Das Initialisierungssignal wird beim ersten Empfang von Daten von der Quelle ausgesendet.

Siehe auch „ isInitialized()“.

bool QAbstractItemModelReplica::isInitialized() const

Gibt „ true “ zurück, wenn diese Replik mit Daten aus dem Source-Objekt initialisiert wurde. Andernfalls wird „ false “ zurückgegeben.

Siehe auch initialized().

[override virtual] void QAbstractItemModelReplica::multiData(const QModelIndex &index, QModelRoleDataSpan roleDataSpan) const

Implementiert: ` QAbstractItemModel::multiData` (const QModelIndex &index, QModelRoleDataSpan roleDataSpan) const.

[override virtual] QModelIndex QAbstractItemModelReplica::parent(const QModelIndex &index) const

Implementiert neu: ` QAbstractItemModel::parent(const QModelIndex &index) const`.

[override virtual] QHash<int, QByteArray> QAbstractItemModelReplica::roleNames() const

Implementiert erneut: ` QAbstractItemModel::roleNames()` const.

size_t QAbstractItemModelReplica::rootCacheSize() const

Gibt die aktuelle Größe des internen Caches zurück. Standardmäßig ist dieser Wert auf den Wert der Umgebungsvariablen ` QTRO_NODES_CACHE_SIZE ` gesetzt oder, falls diese ungültig ist oder nicht existiert, auf den Standardwert ` 1000 `.

Siehe auch setRootCacheSize().

[override virtual] int QAbstractItemModelReplica::rowCount(const QModelIndex &parent = QModelIndex()) const

Implementiert: ` QAbstractItemModel::rowCount(const QModelIndex &parent) const`.

QItemSelectionModel *QAbstractItemModelReplica::selectionModel() const

Gibt einen Zeiger auf den „ QItemSelectionModel “ für den aktuellen „ QAbstractItemModelReplica “ zurück.

[override virtual] bool QAbstractItemModelReplica::setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole)

Implementiert: ` QAbstractItemModel::setData` (const QModelIndex &index, const QVariant &value, int role).

Siehe auch data().

void QAbstractItemModelReplica::setRootCacheSize(size_t rootCacheSize)

Legt die Größe des internen Caches auf „ rootCacheSize “ fest.

Siehe auch rootCacheSize().

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