![]() |
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 } |
![]() | |
typedef void(* | StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **) |
using | ConnectionDataPointer = QExplicitlySharedDataPointer<ConnectionData> |
Definition at line 272 of file qqmldelegatemodel_p_p.h.
|
strong |
Enumerator | |
---|---|
Success | |
Error | |
Retry |
Definition at line 330 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 1092 of file qqmldelegatemodel.cpp.
void QQmlDelegateModelPrivate::addGroups | ( | Compositor::iterator | from, |
int | count, | ||
Compositor::Group | group, | ||
int | groupFlags ) |
Definition at line 1398 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 1862 of file qqmldelegatemodel.cpp.
References emitChanges(), m_complete, m_groupCount, and m_transaction.
void QQmlDelegateModelPrivate::destroyCacheItem | ( | QQmlDelegateModelItem * | cacheItem | ) |
Definition at line 606 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 1061 of file qqmldelegatemodel.cpp.
Referenced by ~QQmlDelegateModelPrivate().
void QQmlDelegateModelPrivate::emitChanges | ( | ) |
Definition at line 1888 of file qqmldelegatemodel.cpp.
References m_reset, and m_transaction.
Referenced by addGroups(), delegateChanged(), removeGroups(), and setGroups().
|
inline |
Definition at line 294 of file qqmldelegatemodel_p_p.h.
void QQmlDelegateModelPrivate::emitCreatedPackage | ( | QQDMIncubationTask * | incubationTask, |
QQuickPackage * | package ) |
Definition at line 884 of file qqmldelegatemodel.cpp.
Referenced by incubatorStatusChanged().
Definition at line 299 of file qqmldelegatemodel_p_p.h.
void QQmlDelegateModelPrivate::emitDestroyingPackage | ( | QQuickPackage * | package | ) |
Definition at line 896 of file qqmldelegatemodel.cpp.
Referenced by incubatorStatusChanged().
|
inline |
Definition at line 296 of file qqmldelegatemodel_p_p.h.
void QQmlDelegateModelPrivate::emitInitPackage | ( | QQDMIncubationTask * | incubationTask, |
QQuickPackage * | package ) |
Definition at line 890 of file qqmldelegatemodel.cpp.
Referenced by setInitialState().
|
overridevirtual |
Implements QQmlDelegateModelGroupEmitter.
Definition at line 1854 of file qqmldelegatemodel.cpp.
|
inlinestatic |
Definition at line 279 of file qqmldelegatemodel_p_p.h.
|
static |
Definition at line 664 of file qqmldelegatemodel.cpp.
References m_complete, and m_groupCount.
|
static |
Definition at line 685 of file qqmldelegatemodel.cpp.
References m_groupCount.
|
static |
Definition at line 678 of file qqmldelegatemodel.cpp.
References m_groupCount.
void QQmlDelegateModelPrivate::incubatorStatusChanged | ( | QQDMIncubationTask * | incubationTask, |
QQmlIncubator::Status | status ) |
Definition at line 1109 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 2119 of file qqmldelegatemodel.cpp.
Definition at line 1446 of file qqmldelegatemodel.cpp.
Definition at line 1594 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 1535 of file qqmldelegatemodel.cpp.
References m_groupCount.
void QQmlDelegateModelPrivate::itemsMoved | ( | const QVector< Compositor::Remove > & | removes, |
const QVector< Compositor::Insert > & | inserts ) |
Definition at line 1794 of file qqmldelegatemodel.cpp.
References m_groupCount.
Definition at line 1742 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 1644 of file qqmldelegatemodel.cpp.
References m_groupCount.
QObject * QQmlDelegateModelPrivate::object | ( | Compositor::Group | group, |
int | index, | ||
QQmlIncubator::IncubationMode | incubationMode ) |
Definition at line 1189 of file qqmldelegatemodel.cpp.
References QQmlDelegateModelItem::groups, QQDMIncubationTask::incubating, QQmlDelegateModelItem::incubationTask, initProxy(), 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 584 of file qqmldelegatemodel.cpp.
References destroyCacheItem(), and removeCacheItem().
void QQmlDelegateModelPrivate::releaseIncubator | ( | QQDMIncubationTask * | incubationTask | ) |
Definition at line 1015 of file qqmldelegatemodel.cpp.
References m_incubatorCleanupScheduled.
Referenced by destroyCacheItem(), and incubatorStatusChanged().
void QQmlDelegateModelPrivate::removeCacheItem | ( | QQmlDelegateModelItem * | cacheItem | ) |
Definition at line 1099 of file qqmldelegatemodel.cpp.
Referenced by QQmlDelegateModelItem::dispose(), incubatorStatusChanged(), object(), and release().
void QQmlDelegateModelPrivate::removeGroups | ( | Compositor::iterator | from, |
int | count, | ||
Compositor::Group | group, | ||
int | groupFlags ) |
Definition at line 1407 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 1076 of file qqmldelegatemodel.cpp.
References m_delegateChooser.
void QQmlDelegateModelPrivate::reuseItem | ( | QQmlDelegateModelItem * | item, |
int | newModelIndex, | ||
int | newGroups ) |
Definition at line 1027 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 1416 of file qqmldelegatemodel.cpp.
References emitChanges().
void QQmlDelegateModelPrivate::setInitialState | ( | QQDMIncubationTask * | incubationTask, |
QObject * | o ) |
Definition at line 1159 of file qqmldelegatemodel.cpp.
References emitInitPackage(), and QQDMIncubationTask::incubating.
void QQmlDelegateModelPrivate::updateFilterGroup | ( | ) |
Definition at line 806 of file qqmldelegatemodel.cpp.
References m_groupCount, and m_parts.
QVariant QQmlDelegateModelPrivate::variantValue | ( | Compositor::Group | group, |
int | index, | ||
const QString & | name ) |
Definition at line 1348 of file qqmldelegatemodel.cpp.
union { ... } QQmlDelegateModelPrivate |
QQmlAdaptorModel QQmlDelegateModelPrivate::m_adaptorModel |
Definition at line 347 of file qqmldelegatemodel_p_p.h.
QList<QQmlDelegateModelItem *> QQmlDelegateModelPrivate::m_cache |
Definition at line 357 of file qqmldelegatemodel_p_p.h.
QQmlDelegateModelGroup* QQmlDelegateModelPrivate::m_cacheItems |
Definition at line 377 of file qqmldelegatemodel_p_p.h.
QQmlRefPointer<QQmlDelegateModelItemMetaType> QQmlDelegateModelPrivate::m_cacheMetaType |
Definition at line 352 of file qqmldelegatemodel_p_p.h.
bool QQmlDelegateModelPrivate::m_complete |
Definition at line 368 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate(), delegateChanged(), and group_append().
QQmlListCompositor QQmlDelegateModelPrivate::m_compositor |
Definition at line 348 of file qqmldelegatemodel_p_p.h.
QQmlListCompositor::Group QQmlDelegateModelPrivate::m_compositorGroup |
Definition at line 367 of file qqmldelegatemodel_p_p.h.
QPointer<QQmlContext> QQmlDelegateModelPrivate::m_context |
Definition at line 353 of file qqmldelegatemodel_p_p.h.
int QQmlDelegateModelPrivate::m_count |
Definition at line 364 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate().
QQmlStrongJSQObjectReference<QQmlComponent> QQmlDelegateModelPrivate::m_delegate |
Definition at line 349 of file qqmldelegatemodel_p_p.h.
QQmlAbstractDelegateComponent* QQmlDelegateModelPrivate::m_delegateChooser |
Definition at line 350 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate(), and resolveDelegate().
QMetaObject::Connection QQmlDelegateModelPrivate::m_delegateChooserChanged |
Definition at line 351 of file qqmldelegatemodel_p_p.h.
bool QQmlDelegateModelPrivate::m_delegateValidated |
Definition at line 369 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate(), and QQmlPartsModel::object().
QString QQmlDelegateModelPrivate::m_filterGroup |
Definition at line 362 of file qqmldelegatemodel_p_p.h.
QList<QQDMIncubationTask *> QQmlDelegateModelPrivate::m_finishedIncubating |
Definition at line 359 of file qqmldelegatemodel_p_p.h.
int QQmlDelegateModelPrivate::m_groupCount |
Definition at line 365 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 381 of file qqmldelegatemodel_p_p.h.
bool QQmlDelegateModelPrivate::m_incubatorCleanupScheduled |
Definition at line 372 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate(), and releaseIncubator().
QQmlDelegateModelGroup* QQmlDelegateModelPrivate::m_items |
Definition at line 378 of file qqmldelegatemodel_p_p.h.
QQmlDelegateModelParts* QQmlDelegateModelPrivate::m_parts |
Definition at line 354 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate(), and updateFilterGroup().
QQmlDelegateModelGroupEmitterList QQmlDelegateModelPrivate::m_pendingParts |
Definition at line 355 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlPartsModel::QQmlPartsModel().
QQmlDelegateModelGroup* QQmlDelegateModelPrivate::m_persistedItems |
Definition at line 379 of file qqmldelegatemodel_p_p.h.
bool QQmlDelegateModelPrivate::m_reset |
Definition at line 370 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate(), and emitChanges().
QQmlReusableDelegateModelItemsPool QQmlDelegateModelPrivate::m_reusableItemsPool |
Definition at line 358 of file qqmldelegatemodel_p_p.h.
bool QQmlDelegateModelPrivate::m_transaction |
Definition at line 371 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate(), delegateChanged(), and emitChanges().
bool QQmlDelegateModelPrivate::m_waitingToFetchMore |
Definition at line 373 of file qqmldelegatemodel_p_p.h.
Referenced by QQmlDelegateModelPrivate(), and requestMoreIfNecessary().
QList<QByteArray> QQmlDelegateModelPrivate::m_watchedRoles |
Definition at line 360 of file qqmldelegatemodel_p_p.h.