The QAbstractItemModelReplica class serves as a convenience class for Replicas of Sources based on QAbstractItemModel . 更多...
| 頭: | #include <QAbstractItemModelReplica> |
| CMake: |
find_package(Qt6 REQUIRED COMPONENTS RemoteObjects)
target_link_libraries(mytarget PRIVATE Qt6::RemoteObjects) |
| qmake: | QT += remoteobjects |
| 繼承: | QAbstractItemModel |
| 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 ) |
| 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 |
| void | initialized () |
QAbstractItemModelReplica makes replicating QAbstractItemModels more efficient by employing caching and pre-fetching.
另請參閱 QAbstractItemModel .
[override virtual]
QAbstractItemModelReplica::
~QAbstractItemModelReplica
()
Destroys the instance of QAbstractItemModelReplica .
Returns a list of available roles.
另請參閱 QAbstractItemModel .
[override virtual]
int
QAbstractItemModelReplica::
columnCount
(const
QModelIndex
&
parent
= QModelIndex()) const
重實現: QAbstractItemModel::columnCount(const QModelIndex &parent) const .
[override virtual]
QVariant
QAbstractItemModelReplica::
data
(const
QModelIndex
&
index
,
int
role
= Qt::DisplayRole) const
重實現: QAbstractItemModel::data(const QModelIndex &index, int role) const .
返迴 role 數據為項在 index if available in cache. A default-constructed QVariant is returned if the index is invalid, the role is not one of the available roles, the 復本 is uninitialized or the data was not available. If the data was not available in cache it will be requested from the Source .
另請參閱 QAbstractItemModel::data (), hasData (), setData (),和 isInitialized ().
[override virtual]
Qt::ItemFlags
QAbstractItemModelReplica::
flags
(const
QModelIndex
&
index
) const
重實現: QAbstractItemModel::flags(const QModelIndex &index) const .
[override virtual]
bool
QAbstractItemModelReplica::
hasChildren
(const
QModelIndex
&
parent
= QModelIndex()) const
重實現: QAbstractItemModel::hasChildren(const QModelIndex &parent) const .
返迴
true
if there exists
role
數據為項在
index
。返迴
false
在任何其它情況下。
[override virtual]
QVariant
QAbstractItemModelReplica::
headerData
(
int
section
,
Qt::Orientation
orientation
,
int
role
) const
重實現: QAbstractItemModel::headerData(int section, Qt::Orientation orientation, int role) const .
返迴數據為給定 role and section 在 Header (頭) 采用指定 orientation .
If the data is not available it will be requested from the Source .
另請參閱 QAbstractItemModel::headerData ().
[override virtual]
QModelIndex
QAbstractItemModelReplica::
index
(
int
row
,
int
column
, const
QModelIndex
&
parent
= QModelIndex()) const
重實現: QAbstractItemModel::index(int row, int column, const QModelIndex &parent) const .
[signal]
void
QAbstractItemModelReplica::
initialized
()
The initialized signal is emitted the first time we receive data from the Source .
另請參閱 isInitialized ().
返迴
true
若此復本已初始化采用數據來自
Source
對象。返迴
false
否則。
另請參閱 initialized ().
[override virtual]
void
QAbstractItemModelReplica::
multiData
(const
QModelIndex
&
index
,
QModelRoleDataSpan
roleDataSpan
) const
重實現: QAbstractItemModel::multiData(const QModelIndex &index, QModelRoleDataSpan roleDataSpan) const .
[override virtual]
QModelIndex
QAbstractItemModelReplica::
parent
(const
QModelIndex
&
index
) const
重實現: QAbstractItemModel::parent(const QModelIndex &index) const .
[override virtual]
QHash
<
int
,
QByteArray
> QAbstractItemModelReplica::
roleNames
() const
重實現: QAbstractItemModel::roleNames() const .
Returns the current size of the internal cache. By default this is set to the value of the
QTRO_NODES_CACHE_SIZE
environment variable, or a default of
1000
if it is invalid or doesn't exist.
另請參閱 setRootCacheSize ().
[override virtual]
int
QAbstractItemModelReplica::
rowCount
(const
QModelIndex
&
parent
= QModelIndex()) const
重實現: QAbstractItemModel::rowCount(const QModelIndex &parent) const .
返迴指針指嚮 QItemSelectionModel 對於當前 QAbstractItemModelReplica .
[override virtual]
bool
QAbstractItemModelReplica::
setData
(const
QModelIndex
&
index
, const
QVariant
&
value
,
int
role
= Qt::EditRole)
重實現: QAbstractItemModel::setData (const QModelIndex &index, const QVariant &value, int role).
另請參閱 data ().
Sets the size of the internal cache to rootCacheSize .
另請參閱 rootCacheSize ().