QAbstractItemModelReplica Class

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

Kopfzeile: #include <QAbstractItemModelReplica>
CMake: find_package(Qt6 REQUIRED COMPONENTS RemoteObjects)
target_link_libraries(mytarget PRIVATE Qt6::RemoteObjects)
qmake: QT += remoteobjects
Vererbt: 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)

Reimplementierte ö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()

Detaillierte Beschreibung

QAbstractItemModelReplica macht die Replikation von QAbstractItemModels effizienter, indem es Caching und Pre-Fetching einsetzt.

Siehe auch QAbstractItemModel.

Dokumentation der Mitgliedsfunktionen

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

Zerstört 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

Reimplements: QAbstractItemModel::columnCount(const QModelIndex &parent) const.

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

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

Gibt die Daten von role für das Element unter index zurück, sofern im Cache verfügbar. Ein standardmäßig konstruiertes QVariant wird zurückgegeben, wenn der Index ungültig ist, die Rolle nicht zu den verfügbaren Rollen gehört, die Replik 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

Reimplements: QAbstractItemModel::flags(const QModelIndex &index) const.

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

Reimplements: QAbstractItemModel::hasChildren(const QModelIndex &parent) const.

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

Gibt true zurück, wenn es role Daten für den Eintrag unter index gibt. Gibt in allen anderen Fällen false zurück.

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

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

Liefert die Daten für die angegebenen role und section in der Kopfzeile mit dem angegebenen orientation.

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

Siehe auch QAbstractItemModel::headerData().

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

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

[signal] void QAbstractItemModelReplica::initialized()

Das initialisierte Signal wird ausgegeben, wenn wir zum ersten Mal Daten von der Quelle erhalten.

Siehe auch isInitialized().

bool QAbstractItemModelReplica::isInitialized() const

Gibt true zurück, wenn dieses Abbild mit Daten aus dem Quellobjekt initialisiert wurde. Gibt andernfalls false zurück.

Siehe auch initialized().

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

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

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

Reimplements: QAbstractItemModel::parent(const QModelIndex &index) const.

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

Reimplements: QAbstractItemModel::roleNames() const.

size_t QAbstractItemModelReplica::rootCacheSize() const

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

Siehe auch setRootCacheSize().

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

Reimplements: QAbstractItemModel::rowCount(const QModelIndex &parent) const.

QItemSelectionModel *QAbstractItemModelReplica::selectionModel() const

Gibt einen Zeiger auf die QItemSelectionModel für die aktuelle QAbstractItemModelReplica zurück.

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

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

Siehe auch data().

void QAbstractItemModelReplica::setRootCacheSize(size_t rootCacheSize)

Setzt die Größe des internen Zwischenspeichers auf rootCacheSize.

Siehe auch rootCacheSize().

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