![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qqmldelegatemodel_p_p.h>
Public Types | |
enum class | InsertionResult { Success , Error , Retry } |
Public Types inherited from QObjectPrivate | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
using | ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData> |
Definition at line 353 of file qqmldelegatemodel_p_p.h.
|
strong |
Enumerator | |
---|---|
Success | |
Error | |
Retry |
Definition at line 411 of file qqmldelegatemodel_p_p.h.
QQmlDelegateModelPrivate::QQmlDelegateModelPrivate | ( | QQmlContext * | ctxt | ) |
Encapsulates a model and delegate.
\qmltype DelegateModel
! \nativetype QQmlDelegateModel \inqmlmodule QtQml.Models
The DelegateModel type encapsulates a model and the delegate that will be instantiated for items in the model.
It is usually not necessary to create a DelegateModel. However, it can be useful for manipulating and accessing the \l modelIndex when a QAbstractItemModel subclass is used as the model. Also, DelegateModel is used together with \l Package to provide delegates to multiple views, and with DelegateModelGroup to sort and filter delegate items.
DelegateModel only supports one-dimensional models – assigning a table model to DelegateModel and that to TableView will thus only show one column.
The example below illustrates using a DelegateModel with a ListView.
Definition at line 162 of file qqmldelegatemodel.cpp.
References m_complete, m_count, m_delegateChooser, m_delegateValidated, m_incubatorCleanupScheduled, m_parts, m_reset, m_transaction, and m_waitingToFetchMore.
QQmlDelegateModelPrivate::~QQmlDelegateModelPrivate | ( | ) |
Definition at line 182 of file qqmldelegatemodel.cpp.
References drainReusableItemsPool().
int QQmlDelegateModelPrivate::adaptorModelCount | ( | ) | const |
Definition at line 190 of file qqmldelegatemodel.cpp.
void QQmlDelegateModelPrivate::addCacheItem | ( | QQmlDelegateModelItem * | item, |
Compositor::iterator | it ) |
Definition at line 1186 of file qqmldelegatemodel.cpp.
void QQmlDelegateModelPrivate::addGroups | ( | Compositor::iterator | from, |
int | count, | ||
Compositor::Group | group, | ||
int | groupFlags ) |
Definition at line 1481 of file qqmldelegatemodel.cpp.
References emitChanges().
void QQmlDelegateModelPrivate::connectModel | ( | QQmlAdaptorModel * | model | ) |
void QQmlDelegateModelPrivate::connectToAbstractItemModel | ( | ) |
Definition at line 349 of file qqmldelegatemodel.cpp.
void QQmlDelegateModelPrivate::delegateChanged | ( | bool | add = true, |
bool | remove = true ) |
Definition at line 1945 of file qqmldelegatemodel.cpp.
References emitChanges(), m_complete, m_groupCount, and m_transaction.
void QQmlDelegateModelPrivate::destroyCacheItem | ( | QQmlDelegateModelItem * | cacheItem | ) |
Definition at line 647 of file qqmldelegatemodel.cpp.
References QQmlDelegateModelItem::destroyObject(), QQmlDelegateModelItem::dispose(), QQmlDelegateModelItem::incubationTask, and releaseIncubator().
Referenced by release().
void QQmlDelegateModelPrivate::disconnectFromAbstractItemModel | ( | ) |
Definition at line 369 of file qqmldelegatemodel.cpp.
void QQmlDelegateModelPrivate::drainReusableItemsPool | ( | int | maxPoolTime | ) |
Definition at line 1155 of file qqmldelegatemodel.cpp.
Referenced by ~QQmlDelegateModelPrivate().
void QQmlDelegateModelPrivate::emitChanges | ( | ) |
Definition at line 1971 of file qqmldelegatemodel.cpp.
References m_reset, and m_transaction.
Referenced by addGroups(), delegateChanged(), removeGroups(), and setGroups().
|
inline |
Definition at line 375 of file qqmldelegatemodel_p_p.h.
void QQmlDelegateModelPrivate::emitCreatedPackage | ( | QQDMIncubationTask * | incubationTask, |
QQuickPackage * | package ) |
Definition at line 925 of file qqmldelegatemodel.cpp.
Referenced by incubatorStatusChanged().
Definition at line 380 of file qqmldelegatemodel_p_p.h.
void QQmlDelegateModelPrivate::emitDestroyingPackage | ( | QQuickPackage * | package | ) |
Definition at line 937 of file qqmldelegatemodel.cpp.
Referenced by incubatorStatusChanged().
|
inline |
Definition at line 377 of file qqmldelegatemodel_p_p.h.
void QQmlDelegateModelPrivate::emitInitPackage | ( | QQDMIncubationTask * | incubationTask, |
QQuickPackage * | package ) |
Definition at line 931 of file qqmldelegatemodel.cpp.
Referenced by setInitialState().
|
overridevirtual |
Implements QQmlDelegateModelGroupEmitter.
Definition at line 1937 of file qqmldelegatemodel.cpp.
|
inlinestatic |
Definition at line 360 of file qqmldelegatemodel_p_p.h.
|
static |
Definition at line 705 of file qqmldelegatemodel.cpp.
References m_complete, and m_groupCount.
|
static |
Definition at line 726 of file qqmldelegatemodel.cpp.
References m_groupCount.
|
static |
Definition at line 719 of file qqmldelegatemodel.cpp.
References m_groupCount.
void QQmlDelegateModelPrivate::incubatorStatusChanged | ( | QQDMIncubationTask * | incubationTask, |
QQmlIncubator::Status | status ) |
Definition at line 1203 of file qqmldelegatemodel.cpp.
References emitCreatedPackage(), emitDestroyingPackage(), QQDMIncubationTask::incubating, QQmlDelegateModelItem::incubationTask, QQmlDelegateModelItem::isObjectReferenced(), QQmlDelegateModelItem::isReferenced(), QQmlDelegateModelItem::referenceObject(), releaseIncubator(), QQmlDelegateModelItem::releaseObject(), removeCacheItem(), and QQmlDelegateModelItem::scriptRef.
void QQmlDelegateModelPrivate::init | ( | ) |
Definition at line 207 of file qqmldelegatemodel.cpp.
QQmlDelegateModelPrivate::InsertionResult QQmlDelegateModelPrivate::insert | ( | Compositor::insert_iterator & | before, |
const QV4::Value & | object, | ||
int | groups ) |
Definition at line 2204 of file qqmldelegatemodel.cpp.
Definition at line 1529 of file qqmldelegatemodel.cpp.
Definition at line 1677 of file qqmldelegatemodel.cpp.
void QQmlDelegateModelPrivate::itemsInserted | ( | const QVector< Compositor::Insert > & | inserts, |
QVarLengthArray< QVector< QQmlChangeSet::Change >, Compositor::MaximumGroupCount > * | translatedInserts, | ||
QHash< int, QList< QQmlDelegateModelItem * > > * | movedItems = nullptr ) |
Definition at line 1618 of file qqmldelegatemodel.cpp.
References m_groupCount.
void QQmlDelegateModelPrivate::itemsMoved | ( | const QVector< Compositor::Remove > & | removes, |
const QVector< Compositor::Insert > & | inserts ) |
Definition at line 1877 of file qqmldelegatemodel.cpp.
References m_groupCount.
Definition at line 1825 of file qqmldelegatemodel.cpp.
void QQmlDelegateModelPrivate::itemsRemoved | ( | const QVector< Compositor::Remove > & | removes, |
QVarLengthArray< QVector< QQmlChangeSet::Change >, Compositor::MaximumGroupCount > * | translatedRemoves, | ||
QHash< int, QList< QQmlDelegateModelItem * > > * | movedItems = nullptr ) |
Definition at line 1727 of file qqmldelegatemodel.cpp.
References m_groupCount.
QObject * QQmlDelegateModelPrivate::object | ( | Compositor::Group | group, |
int | index, | ||
QQmlIncubator::IncubationMode | incubationMode ) |
Definition at line 1266 of file qqmldelegatemodel.cpp.
References QQmlDelegateModelItem::groups, QQDMIncubationTask::incubating, QQmlDelegateModelItem::incubationTask, QQmlDelegateModelItem::isReferenced(), m_groupCount, QQmlDelegateModelItem::objectRef, QQmlDelegateModelItem::referenceObject(), QQmlDelegateModelItem::releaseObject(), removeCacheItem(), requestMoreIfNecessary(), reuseItem(), and QQmlDelegateModelItem::scriptRef.
QQmlDelegateModel::ReleaseFlags QQmlDelegateModelPrivate::release | ( | QObject * | object, |
QQmlInstanceModel::ReusableFlag | reusable = QQmlInstanceModel::NotReusable ) |
Definition at line 625 of file qqmldelegatemodel.cpp.
References destroyCacheItem(), and removeCacheItem().
void QQmlDelegateModelPrivate::releaseIncubator | ( | QQDMIncubationTask * | incubationTask | ) |
Definition at line 1109 of file qqmldelegatemodel.cpp.
References m_incubatorCleanupScheduled.
Referenced by destroyCacheItem(), and incubatorStatusChanged().
void QQmlDelegateModelPrivate::removeCacheItem | ( | QQmlDelegateModelItem * | cacheItem | ) |
Definition at line 1193 of file qqmldelegatemodel.cpp.
Referenced by incubatorStatusChanged(), object(), and release().
void QQmlDelegateModelPrivate::removeGroups | ( | Compositor::iterator | from, |
int | count, | ||
Compositor::Group | group, | ||
int | groupFlags ) |
Definition at line 1490 of file qqmldelegatemodel.cpp.
References emitChanges().
void QQmlDelegateModelPrivate::requestMoreIfNecessary | ( | ) |
Definition at line 198 of file qqmldelegatemodel.cpp.
References m_waitingToFetchMore.
Referenced by object().
QQmlComponent * QQmlDelegateModelPrivate::resolveDelegate | ( | int | index | ) |
Definition at line 1170 of file qqmldelegatemodel.cpp.
References m_delegateChooser.
void QQmlDelegateModelPrivate::reuseItem | ( | QQmlDelegateModelItem * | item, |
int | newModelIndex, | ||
int | newGroups ) |
Definition at line 1121 of file qqmldelegatemodel.cpp.
References QQmlDelegateModelAttached::emitChanges(), QQmlDelegateModelItem::groups, QQmlDelegateModelAttached::resetCurrentIndex(), and QQmlDelegateModelItem::setModelIndex().
Referenced by object().
void QQmlDelegateModelPrivate::setGroups | ( | Compositor::iterator | from, |
int | count, | ||
Compositor::Group | group, | ||
int | groupFlags ) |
Definition at line 1499 of file qqmldelegatemodel.cpp.
References emitChanges().
void QQmlDelegateModelPrivate::setInitialState | ( | QQDMIncubationTask * | incubationTask, |
QObject * | o ) |
Definition at line 1253 of file qqmldelegatemodel.cpp.
References emitInitPackage(), and QQDMIncubationTask::incubating.
void QQmlDelegateModelPrivate::updateFilterGroup | ( | ) |
Definition at line 847 of file qqmldelegatemodel.cpp.
References m_groupCount, and m_parts.
QVariant QQmlDelegateModelPrivate::variantValue | ( | Compositor::Group | group, |
int | index, | ||
const QString & | name ) |
Definition at line 1431 of file qqmldelegatemodel.cpp.
union { ... } QQmlDelegateModelPrivate |
QQmlAdaptorModel QQmlDelegateModelPrivate::m_adaptorModel |
Definition at line 428 of file qqmldelegatemodel_p_p.h.
QList<QQmlDelegateModelItem *> QQmlDelegateModelPrivate::m_cache |
Definition at line 438 of file qqmldelegatemodel_p_p.h.
QQmlDelegateModelGroup* QQmlDelegateModelPrivate::m_cacheItems |
Definition at line 458 of file qqmldelegatemodel_p_p.h.
QQmlRefPointer<QQmlDelegateModelItemMetaType> QQmlDelegateModelPrivate::m_cacheMetaType |
Definition at line 433 of file qqmldelegatemodel_p_p.h.
bool QQmlDelegateModelPrivate::m_complete |
Definition at line 449 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate(), delegateChanged(), and group_append().
QQmlListCompositor QQmlDelegateModelPrivate::m_compositor |
Definition at line 429 of file qqmldelegatemodel_p_p.h.
QQmlListCompositor::Group QQmlDelegateModelPrivate::m_compositorGroup |
Definition at line 448 of file qqmldelegatemodel_p_p.h.
QPointer<QQmlContext> QQmlDelegateModelPrivate::m_context |
Definition at line 434 of file qqmldelegatemodel_p_p.h.
int QQmlDelegateModelPrivate::m_count |
Definition at line 445 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate().
QQmlStrongJSQObjectReference<QQmlComponent> QQmlDelegateModelPrivate::m_delegate |
Definition at line 430 of file qqmldelegatemodel_p_p.h.
QQmlAbstractDelegateComponent* QQmlDelegateModelPrivate::m_delegateChooser |
Definition at line 431 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate(), and resolveDelegate().
QMetaObject::Connection QQmlDelegateModelPrivate::m_delegateChooserChanged |
Definition at line 432 of file qqmldelegatemodel_p_p.h.
bool QQmlDelegateModelPrivate::m_delegateValidated |
Definition at line 450 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate(), and QQmlPartsModel::object().
QString QQmlDelegateModelPrivate::m_filterGroup |
Definition at line 443 of file qqmldelegatemodel_p_p.h.
QList<QQDMIncubationTask *> QQmlDelegateModelPrivate::m_finishedIncubating |
Definition at line 440 of file qqmldelegatemodel_p_p.h.
int QQmlDelegateModelPrivate::m_groupCount |
Definition at line 446 of file qqmldelegatemodel_p_p.h.
Referenced by delegateChanged(), group_append(), group_at(), group_count(), itemsInserted(), itemsMoved(), itemsRemoved(), object(), updateFilterGroup(), and QQmlPartsModel::updateFilterGroup().
QQmlDelegateModelGroup* QQmlDelegateModelPrivate::m_groups[Compositor::MaximumGroupCount] |
Definition at line 462 of file qqmldelegatemodel_p_p.h.
bool QQmlDelegateModelPrivate::m_incubatorCleanupScheduled |
Definition at line 453 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate(), and releaseIncubator().
QQmlDelegateModelGroup* QQmlDelegateModelPrivate::m_items |
Definition at line 459 of file qqmldelegatemodel_p_p.h.
QQmlDelegateModelParts* QQmlDelegateModelPrivate::m_parts |
Definition at line 435 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate(), and updateFilterGroup().
QQmlDelegateModelGroupEmitterList QQmlDelegateModelPrivate::m_pendingParts |
Definition at line 436 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlPartsModel::QQmlPartsModel().
QQmlDelegateModelGroup* QQmlDelegateModelPrivate::m_persistedItems |
Definition at line 460 of file qqmldelegatemodel_p_p.h.
bool QQmlDelegateModelPrivate::m_reset |
Definition at line 451 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate(), and emitChanges().
QQmlReusableDelegateModelItemsPool QQmlDelegateModelPrivate::m_reusableItemsPool |
Definition at line 439 of file qqmldelegatemodel_p_p.h.
bool QQmlDelegateModelPrivate::m_transaction |
Definition at line 452 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate(), delegateChanged(), and emitChanges().
bool QQmlDelegateModelPrivate::m_waitingToFetchMore |
Definition at line 454 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate(), and requestMoreIfNecessary().
QList<QByteArray> QQmlDelegateModelPrivate::m_watchedRoles |
Definition at line 441 of file qqmldelegatemodel_p_p.h.