Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmldelegatemodel_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant
4
5#ifndef QQMLDATAMODEL_P_P_H
6#define QQMLDATAMODEL_P_P_H
7
9#include <private/qv4qobjectwrapper_p.h>
10
11#include <QtQml/qqmlcontext.h>
12#include <QtQml/qqmlincubator.h>
13
14#include <private/qqmladaptormodel_p.h>
15#include <private/qqmlopenmetaobject_p.h>
16
17#include <QtCore/qloggingcategory.h>
18#include <QtCore/qpointer.h>
19
20//
21// W A R N I N G
22// -------------
23//
24// This file is not part of the Qt API. It exists purely as an
25// implementation detail. This header file may change from version to
26// version without notice, or even be removed.
27//
28// We mean it.
29//
30
32
34
36
38
39class QQmlDelegateModelAttachedMetaObject;
40class QQmlAbstractDelegateComponent;
41class QQmlTableInstanceModel;
42
43class Q_QMLMODELS_EXPORT QQmlDelegateModelItemMetaType final
44 : public QQmlRefCounted<QQmlDelegateModelItemMetaType>
45{
46public:
47 enum class ModelKind : quint8 {
48 InstanceModel,
49 DelegateModel,
50 TableInstanceModel,
51 };
52
53 QQmlDelegateModelItemMetaType(
54 QV4::ExecutionEngine *engine, QQmlDelegateModel *model, const QStringList &groupNames);
55 QQmlDelegateModelItemMetaType(
56 QV4::ExecutionEngine *engine, QQmlTableInstanceModel *model);
57 ~QQmlDelegateModelItemMetaType();
58
59 void initializeAttachedMetaObject();
60 void initializePrototype();
61
62 int parseGroups(const QStringList &groupNames) const;
63 int parseGroups(const QV4::Value &groupNames) const;
64
65 QQmlDelegateModel *delegateModel() const
66 {
67 return modelKind == ModelKind::DelegateModel
68 ? static_cast<QQmlDelegateModel *>(model.get())
69 : nullptr;
70 }
71
72 qsizetype groupCount() const { return groupNames.size(); }
73
74 void emitModelChanged() const;
75
76 QPointer<QQmlInstanceModel> model;
77 QV4::ExecutionEngine * const v4Engine;
78 QQmlRefPointer<QQmlDelegateModelAttachedMetaObject> attachedMetaObject;
79 const QStringList groupNames;
80 QV4::PersistentValue modelItemProto;
81 ModelKind modelKind = ModelKind::InstanceModel;
82};
83
84class QQmlAdaptorModel;
86
88{
89 Q_OBJECT
90 Q_PROPERTY(int index READ modelIndex NOTIFY modelIndexChanged)
94public:
112
134
146
147 QQmlDelegateModelItem(const QQmlRefPointer<QQmlDelegateModelItemMetaType> &metaType,
148 QQmlAdaptorModel::Accessors *accessor, int modelIndex,
149 int row, int column);
151
153 {
154 Q_ASSERT(m_object);
155 ++m_objectWeakRef;
156 return m_object;
157 }
158
160 {
161 if (m_objectWeakRef > 0)
162 --m_objectWeakRef;
163 return !isObjectReferenced();
164 }
166 {
167 m_objectWeakRef = 0;
168 }
169
171 {
172 return m_objectWeakRef != 0
173 || m_objectStrongRef != 0
174 || (m_groups & Compositor::PersistedFlag);
175 }
176 void childContextObjectDestroyed(QObject *childContextObject);
177
178 bool isScriptReferenced() const {
179 return m_scriptRef
180 || m_incubationTask
181 || ((m_groups & Compositor::UnresolvedFlag) && (m_groups & Compositor::GroupMask));
182 }
183
184 void dispose();
185
186 QObject *modelObject() { return this; }
187
188 void destroyObject();
189 void destroyObjectLater();
190
191 static QQmlDelegateModelItem *dataForObject(QObject *object);
192
193 int groupIndex(Compositor::Group group);
194
195 int modelRow() const { return m_row; }
196 int modelColumn() const { return m_column; }
197 int modelIndex() const { return m_index; }
198 bool hasValidModelIndex() const { return m_index >= 0; }
199 virtual void setModelIndex(int idx, int newRow, int newColumn, bool alwaysEmit = false);
200
201 bool usesStructuredModelData() const { return m_useStructuredModelData; }
202
203 virtual QV4::ReturnedValue get() { return QV4::QObjectWrapper::wrap(m_metaType->v4Engine, this); }
204
205 virtual void setValue(const QString &role, const QVariant &value) { Q_UNUSED(role); Q_UNUSED(value); }
206 virtual bool resolveIndex(const QQmlAdaptorModel &, int) { return false; }
207 virtual QQmlRefPointer<QQmlContextData> initProxy() { return m_contextData; }
208
209 static QV4::ReturnedValue get_model(const QV4::FunctionObject *, const QV4::Value *thisObject, const QV4::Value *argv, int argc);
210 static QV4::ReturnedValue get_groups(const QV4::FunctionObject *, const QV4::Value *thisObject, const QV4::Value *argv, int argc);
211 static QV4::ReturnedValue set_groups(const QV4::FunctionObject *, const QV4::Value *thisObject, const QV4::Value *argv, int argc);
212 static QV4::ReturnedValue get_member(QQmlDelegateModelItem *thisItem, uint flag, const QV4::Value &);
213 static QV4::ReturnedValue set_member(QQmlDelegateModelItem *thisItem, uint flag, const QV4::Value &arg);
214 static QV4::ReturnedValue get_index(QQmlDelegateModelItem *thisItem, uint flag, const QV4::Value &arg);
215
216
218 {
219 if (!m_object)
220 return nullptr;
221
222 QQmlData *ddata = QQmlData::get(m_object);
223 if (!ddata || !ddata->hasExtendedData())
224 return nullptr;
225
226 return static_cast<QQmlDelegateModelAttached *>(
227 ddata->attachedProperties()->value(
228 QQmlPrivate::attachedPropertiesFunc<QQmlDelegateModel>()));
229 }
230
231 void disableStructuredModelData() { m_useStructuredModelData = false; }
232
233 QDynamicMetaObjectData *exchangeMetaObject(QDynamicMetaObjectData *metaObject)
234 {
235 return std::exchange(d_ptr->metaObject, metaObject);
236 }
237
238 QQDMIncubationTask *incubationTask() const { return m_incubationTask; }
239 void clearIncubationTask() { m_incubationTask = nullptr; }
241 {
242 Q_ASSERT(!m_incubationTask);
243 Q_ASSERT(incubationTask);
244 m_incubationTask = incubationTask;
245 }
246
247 quint16 objectStrongRef() const { return m_objectStrongRef; }
248 quint16 objectWeakRef() const { return m_objectWeakRef; }
249 quint16 scriptRef() const { return m_scriptRef; }
250
251 QObject *object() const { return m_object; }
252 void setObject(QObject *object) {
253 Q_ASSERT(!m_object);
254 Q_ASSERT(object);
255 m_object = object;
256 }
257
258 QQmlComponent *delegate() const { return m_delegate; }
259 void setDelegate(QQmlComponent *delegate) { m_delegate = delegate; }
260
261 const QQmlRefPointer<QQmlContextData> &contextData() const { return m_contextData; }
262 void setContextData(const QQmlRefPointer<QQmlContextData> &contextData)
263 {
264 m_contextData = contextData;
265 }
266
267 int groups() const { return m_groups; }
268 void setGroups(int groups) { m_groups = groups; }
269 void addGroups(int groups) { m_groups |= groups; }
270 void removeGroups(int groups) { m_groups &= ~groups; }
271 void clearGroups() { m_groups = 0; }
272
273 const QQmlRefPointer<QQmlDelegateModelItemMetaType> &metaType() const { return m_metaType; }
274
277 Q_REVISION(2, 12) void rowChanged();
279
280private:
281 void objectDestroyed(QObject *);
282
283 void referenceSript() { ++m_scriptRef; }
284 bool releaseScript()
285 {
286 Q_ASSERT(m_scriptRef > 0);
287 return --m_scriptRef == 0;
288 }
289
290 QQmlRefPointer<QQmlDelegateModelItemMetaType> m_metaType;
291 QQmlRefPointer<QQmlContextData> m_contextData;
292 QPointer<QObject> m_object;
293 QQDMIncubationTask *m_incubationTask = nullptr;
294 QQmlComponent *m_delegate = nullptr;
295 int m_groups = 0;
296 int m_index = -1;
297 int m_row = -1;
298 int m_column = -1;
299
300 // A strong reference to the object prevents the deletion of the object. We use them as
301 // temporary guards with ObjectReference or ObjectSpanReference to make sure the objects we're
302 // currently manipulating don't disappear.
303 quint16 m_objectStrongRef = 0;
304
305 // A weak reference to the object is added when handing the object out to the view via object().
306 // It is dropped when the view calls release(). Weak references are advisory. We try not to
307 // delete an object while weak references are still in place. However, during destruction, the
308 // weak refernces may be ignored. Views are expected to use QPointer or similar guards in
309 // addition.
310 quint16 m_objectWeakRef = 0;
311
312 // A script reference is a strong reference to the QQmlDelegateModelItem itself. We don't delete
313 // the QQmlDelegateModelItem while script references are still in place. We can use them as
314 // temporary guards to hold on to an item while working on it, or we can attach them to
315 // Heap::QQmlDelegateModelItemObject in order to extend the life time of a QQmlDelegateModelItem
316 // to the life time of its heap object.
317 // The latter case is particular in that it contradicts our usual mechanism of only holding weak
318 // references to QObjects in e.g. QV4::QObjectWrapper. The trick here is that the actual
319 // QQmlDelegateModelItem is never exposed to the user, so that the user has no chance of
320 // manually deleting it.
321 // TODO: This is brittle.
322 quint16 m_scriptRef = 0;
323
324 bool m_useStructuredModelData = true;
325};
326
327namespace QV4 {
328namespace Heap {
330 inline void init(QQmlDelegateModelItem *item);
331 void destroy();
332
333 alignas(alignof(QQmlDelegateModelItem::ScriptReference))
335
337 return reinterpret_cast<const QQmlDelegateModelItem::ScriptReference *>(&ref)->data();
338 }
339};
340
341}
342}
343
345{
346 V4_OBJECT2(QQmlDelegateModelItemObject, QV4::Object)
348};
349
351{
352 Object::init();
353 new (ref) QQmlDelegateModelItem::ScriptReference(modelItem);
354}
355
357{
358public:
359 bool insertItem(QQmlDelegateModelItem *modelItem);
360 QQmlDelegateModelItem *takeItem(const QQmlComponent *delegate, int newIndexHint);
361 void reuseItem(QQmlDelegateModelItem *item, int newModelIndex);
362 void drain(int maxPoolTime, std::function<void(QQmlDelegateModelItem *cacheItem)> releaseItem);
363 int size()
364 {
365 Q_ASSERT(m_reusableItemsPool.size() <= MaxSize);
366 return int(m_reusableItemsPool.size());
367 }
368
369private:
370 struct PoolItem
371 {
372 QQmlDelegateModelItem *item = nullptr;
373 int poolTime = 0;
374 };
375
376 static constexpr size_t MaxSize = size_t(std::numeric_limits<int>::max());
377
378 std::vector<PoolItem> m_reusableItemsPool;
379};
380
381template<typename Target>
383{
385
386public:
394
400
402 {
403 if (target)
405 }
406
411
413 {
414 if (!target)
415 return 0;
416
418 return 0;
419
420 return original->metaCall(o, call, id, argv);
421 }
422
423private:
424 Target target = {};
425 QDynamicMetaObjectData *original = nullptr;
426 int readOnlyProperty = -1;
427};
428
431{
432public:
435 , incubating(nullptr)
436 , vdm(l) {}
437
439 QQmlDelegateModelItem *modelItemToIncubate, QObject* object,
440 QQmlDelegateModel::DelegateModelAccess access);
441 void statusChanged(Status) override;
442 void setInitialState(QObject *) override;
443
447 QPointer<QObject> proxiedObject = nullptr; // the proxied object might disapear, so we use a QPointer instead of a raw one
449};
450
451
453{
454public:
456 virtual void emitModelUpdated(const QQmlChangeSet &changeSet, bool reset) = 0;
457 virtual void createdPackage(int, QQuickPackage *);
458 virtual void initPackage(int, QQuickPackage *);
459 virtual void destroyingPackage(QQuickPackage *);
460
462};
463
465
467{
468public:
469 Q_DECLARE_PUBLIC(QQmlDelegateModelGroup)
470
472
475
477 bool isChangedConnected();
478 void emitChanges(QV4::ExecutionEngine *engine);
479 void emitModelUpdated(bool reset);
480
481 void createdPackage(int index, QQuickPackage *package);
482 void initPackage(int index, QQuickPackage *package);
483 void destroyingPackage(QQuickPackage *package);
484
485 bool parseIndex(const QV4::Value &value, int *index, Compositor::Group *group) const;
486 bool parseGroupArgs(
487 QQmlV4FunctionPtr args, Compositor::Group *group, int *index, int *count, int *groups) const;
488
492 QQmlChangeSet changeSet;
495};
496
498
500{
501 Q_DECLARE_PUBLIC(QQmlDelegateModel)
502public:
505
506 static QQmlDelegateModelPrivate *get(QQmlDelegateModel *m) {
507 return static_cast<QQmlDelegateModelPrivate *>(QObjectPrivate::get(m));
508 }
509
510 void init();
511 void connectModel(QQmlAdaptorModel *model);
514
516 QObject *object(Compositor::Group group, int index, QQmlIncubator::IncubationMode incubationMode);
518 QVariant variantValue(Compositor::Group group, int index, const QString &name);
519 void emitCreatedPackage(QQDMIncubationTask *incubationTask, QQuickPackage *package);
520 void emitInitPackage(QQDMIncubationTask *incubationTask, QQuickPackage *package);
521 void emitCreatedItem(QQDMIncubationTask *incubationTask, QObject *item) {
522 Q_EMIT q_func()->createdItem(incubationTask->index[m_compositorGroup], item); }
523 void emitInitItem(QQDMIncubationTask *incubationTask, QObject *item) {
524 Q_EMIT q_func()->initItem(incubationTask->index[m_compositorGroup], item); }
525 void emitDestroyingPackage(QQuickPackage *package);
526 void emitDestroyingItem(QObject *item) { Q_EMIT q_func()->destroyingItem(item); }
527 void addCacheItem(QQmlDelegateModelItem *item, Compositor::iterator it);
528 void removeCacheItem(QQmlDelegateModelItem *cacheItem);
530 void updateFilterGroup();
531
532 void reuseItem(QQmlDelegateModelItem *item, int newModelIndex, int newGroups);
533 void drainReusableItemsPool(int maxPoolTime);
534 QQmlComponent *resolveDelegate(int index);
535
536 void addGroups(Compositor::iterator from, int count, Compositor::Group group, int groupFlags);
537 void removeGroups(Compositor::iterator from, int count, Compositor::Group group, int groupFlags);
538 void setGroups(Compositor::iterator from, int count, Compositor::Group group, int groupFlags);
539
540 void itemsInserted(
541 const QList<Compositor::Insert> &inserts,
542 QVarLengthArray<QList<QQmlChangeSet::Change>, Compositor::MaximumGroupCount> *translatedInserts,
543 QHash<int, QList<QQmlDelegateModelItem *> > *movedItems = nullptr);
544 void itemsInserted(const QList<Compositor::Insert> &inserts);
545 void itemsRemoved(
546 const QList<Compositor::Remove> &removes,
547 QVarLengthArray<QList<QQmlChangeSet::Change>, Compositor::MaximumGroupCount> *translatedRemoves,
548 QHash<int, QList<QQmlDelegateModelItem *> > *movedItems = nullptr);
549 void itemsRemoved(const QList<Compositor::Remove> &removes);
550 void itemsMoved(
551 const QList<Compositor::Remove> &removes, const QList<Compositor::Insert> &inserts);
552 void itemsChanged(const QList<Compositor::Change> &changes);
553 void emitChanges();
554 void emitModelUpdated(const QQmlChangeSet &changeSet, bool reset) override;
555 void delegateChanged(bool add = true, bool remove = true);
556
562 InsertionResult insert(Compositor::insert_iterator &before, const QV4::Value &object, int groups);
563
564 int adaptorModelCount() const;
565
566 static void group_append(QQmlListProperty<QQmlDelegateModelGroup> *property, QQmlDelegateModelGroup *group);
567 static qsizetype group_count(QQmlListProperty<QQmlDelegateModelGroup> *property);
568 static QQmlDelegateModelGroup *group_at(QQmlListProperty<QQmlDelegateModelGroup> *property, qsizetype index);
569
570 void releaseIncubator(QQDMIncubationTask *incubationTask);
571 void incubatorStatusChanged(QQDMIncubationTask *incubationTask, QQmlIncubator::Status status);
572 void setInitialState(QQDMIncubationTask *incubationTask, QObject *o);
573
574 QQmlAdaptorModel m_adaptorModel;
577 QQmlAbstractDelegateComponent *m_delegateChooser;
583
588
590
593
595 bool m_complete : 1;
597 bool m_reset : 1;
601
602 union {
603 struct {
604 QQmlDelegateModelGroup *m_cacheItems;
605 QQmlDelegateModelGroup *m_items;
606 QQmlDelegateModelGroup *m_persistedItems;
607 };
608 QQmlDelegateModelGroup *m_groups[Compositor::MaximumGroupCount];
609 };
610};
611
613{
614 Q_OBJECT
615 Q_PROPERTY(QString filterOnGroup READ filterGroup WRITE setFilterGroup NOTIFY filterGroupChanged RESET resetFilterGroup FINAL)
616public:
619
620 QString filterGroup() const;
621 void setFilterGroup(const QString &group);
622 void resetFilterGroup();
623 void updateFilterGroup();
624 void updateFilterGroup(Compositor::Group group, const QQmlChangeSet &changeSet);
625
626 int count() const override;
627 bool isValid() const override;
628 QObject *object(int index, QQmlIncubator::IncubationMode incubationMode = QQmlIncubator::AsynchronousIfNested) override;
629 ReleaseFlags release(QObject *item, ReusableFlag reusable = NotReusable) override;
630 QVariant variantValue(int index, const QString &role) override;
631 QList<QByteArray> watchedRoles() const { return m_watchedRoles; }
632 void setWatchedRoles(const QList<QByteArray> &roles) override;
633 QQmlIncubator::Status incubationStatus(int index) override;
634
635 int indexOf(QObject *item, QObject *objectContext) const override;
636
637 void emitModelUpdated(const QQmlChangeSet &changeSet, bool reset) override;
638
639 void createdPackage(int index, QQuickPackage *package) override;
640 void initPackage(int index, QQuickPackage *package) override;
641 void destroyingPackage(QQuickPackage *package) override;
642
645
646private:
647 QQmlDelegateModel *m_model;
648 QMultiHash<QObject *, QQuickPackage *> m_packaged;
649 QString m_part;
650 QString m_filterGroup;
651 QList<QByteArray> m_watchedRoles;
652 QList<int> m_pendingPackageInitializations; // vector holds model indices
653 Compositor::Group m_compositorGroup;
654 bool m_inheritGroup;
655 bool m_modelUpdatePending = true;
656};
657
658class QMetaPropertyBuilder;
659
661{
662public:
665
666 void propertyCreated(int, QMetaPropertyBuilder &) override;
667 QVariant initialValue(int) override;
668};
669
679
680class QQmlDelegateModelAttachedMetaObject final
681 : public QAbstractDynamicMetaObject,
682 public QQmlRefCounted<QQmlDelegateModelAttachedMetaObject>
683{
684public:
686 QQmlDelegateModelItemMetaType *metaType, QMetaObject *metaObject);
688
689 void objectDestroyed(QObject *) override;
690 int metaCall(QObject *, QMetaObject::Call, int _id, void **) override;
691
692private:
693 QQmlDelegateModelItemMetaType * const metaType;
694 QMetaObject * const metaObject;
695 const int memberPropertyOffset;
696 const int indexPropertyOffset;
697};
698
699QT_END_NAMESPACE
700
701#endif
void initializeRequiredProperties(QQmlDelegateModelItem *modelItemToIncubate, QObject *object, QQmlDelegateModel::DelegateModelAccess access)
QPointer< QObject > proxiedObject
QQmlRefPointer< QQmlContextData > proxyContext
void statusChanged(Status) override
Called when the status of the incubator changes.
void setInitialState(QObject *) override
Called after the object is first created, but before complex property bindings are evaluated and,...
int index[QQmlListCompositor::MaximumGroupCount]
QQmlDelegateModelItem * incubating
QQDMIncubationTask(QQmlDelegateModelPrivate *l, IncubationMode mode)
QQmlDelegateModelPrivate * vdm
QQmlDelegateModelAttachedMetaObject(QQmlDelegateModelItemMetaType *metaType, QMetaObject *metaObject)
int metaCall(QObject *, QMetaObject::Call, int _id, void **) override
QQmlDelegateModelAttached(QQmlDelegateModelItem *cacheItem, QObject *parent)
void setGroups(const QStringList &groups)
bool isUnresolved() const
\qmlattachedproperty bool QtQml.Models::DelegateModel::isUnresolved
void emitChanges()
\qmlattachedproperty bool QtQml.Models::DelegateModel::inItems
void setInPersistedItems(bool inPersisted)
QQmlDelegateModel * model() const
\qmlattachedproperty model QtQml.Models::DelegateModel::model
QStringList groups() const
\qmlattachedproperty stringlist QtQml.Models::DelegateModel::groups
QQmlDelegateModelItem * m_cacheItem
QV4::ReturnedValue array(QV4::ExecutionEngine *engine, const QList< QQmlChangeSet::Change > &changes)
QQmlDelegateModelEngineData(QV4::ExecutionEngine *v4)
virtual void initPackage(int, QQuickPackage *)
virtual void destroyingPackage(QQuickPackage *)
virtual void emitModelUpdated(const QQmlChangeSet &changeSet, bool reset)=0
virtual void createdPackage(int, QQuickPackage *)
bool parseIndex(const QV4::Value &value, int *index, Compositor::Group *group) const
void createdPackage(int index, QQuickPackage *package)
QPointer< QQmlDelegateModel > model
bool parseGroupArgs(QQmlV4FunctionPtr args, Compositor::Group *group, int *index, int *count, int *groups) const
void initPackage(int index, QQuickPackage *package)
QQmlDelegateModelGroupEmitterList emitters
void destroyingPackage(QQuickPackage *package)
void emitChanges(QV4::ExecutionEngine *engine)
const QQmlRefPointer< QQmlDelegateModelItemMetaType > & metaType() const
void setObject(QObject *object)
void setContextData(const QQmlRefPointer< QQmlContextData > &contextData)
static QV4::ReturnedValue set_member(QQmlDelegateModelItem *thisItem, uint flag, const QV4::Value &arg)
void childContextObjectDestroyed(QObject *childContextObject)
virtual void setValue(const QString &role, const QVariant &value)
virtual QV4::ReturnedValue get()
static QV4::ReturnedValue get_member(QQmlDelegateModelItem *thisItem, uint flag, const QV4::Value &)
static QV4::ReturnedValue get_index(QQmlDelegateModelItem *thisItem, uint flag, const QV4::Value &arg)
static QV4::ReturnedValue get_groups(const QV4::FunctionObject *, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
int groupIndex(Compositor::Group group)
QDynamicMetaObjectData * exchangeMetaObject(QDynamicMetaObjectData *metaObject)
virtual bool resolveIndex(const QQmlAdaptorModel &, int)
QQmlComponent * delegate() const
void setDelegate(QQmlComponent *delegate)
void setIncubationTask(QQDMIncubationTask *incubationTask)
static QQmlDelegateModelItem * dataForObject(QObject *object)
static QV4::ReturnedValue get_model(const QV4::FunctionObject *, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
virtual void setModelIndex(int idx, int newRow, int newColumn, bool alwaysEmit=false)
virtual QQmlRefPointer< QQmlContextData > initProxy()
QQmlDelegateModelItem(const QQmlRefPointer< QQmlDelegateModelItemMetaType > &metaType, QQmlAdaptorModel::Accessors *accessor, int modelIndex, int row, int column)
QQmlDelegateModelAttached * attached() const
static QV4::ReturnedValue set_groups(const QV4::FunctionObject *, const QV4::Value *thisObject, const QV4::Value *argv, int argc)
const QQmlRefPointer< QQmlContextData > & contextData() const
QQDMIncubationTask * incubationTask() const
Q_REVISION(2, 12) void rowChanged()
void propertyCreated(int, QMetaPropertyBuilder &) override
QList< QQmlPartsModel * > models
void setInitialState(QQDMIncubationTask *incubationTask, QObject *o)
void removeCacheItem(QQmlDelegateModelItem *cacheItem)
QVariant variantValue(Compositor::Group group, int index, const QString &name)
void emitCreatedPackage(QQDMIncubationTask *incubationTask, QQuickPackage *package)
QList< QQDMIncubationTask * > m_finishedIncubating
void connectModel(QQmlAdaptorModel *model)
QList< QQmlDelegateModelItem * > m_cache
void itemsMoved(const QList< Compositor::Remove > &removes, const QList< Compositor::Insert > &inserts)
QQmlDelegateModelParts * m_parts
static qsizetype group_count(QQmlListProperty< QQmlDelegateModelGroup > *property)
QList< QByteArray > m_watchedRoles
QQmlAbstractDelegateComponent * m_delegateChooser
QPointer< QQmlContext > m_context
void itemsInserted(const QList< Compositor::Insert > &inserts)
void emitCreatedItem(QQDMIncubationTask *incubationTask, QObject *item)
void emitInitItem(QQDMIncubationTask *incubationTask, QObject *item)
static void group_append(QQmlListProperty< QQmlDelegateModelGroup > *property, QQmlDelegateModelGroup *group)
QQmlStrongJSQObjectReference< QQmlComponent > m_delegate
void emitDestroyingItem(QObject *item)
void addCacheItem(QQmlDelegateModelItem *item, Compositor::iterator it)
QQmlRefPointer< QQmlDelegateModelItemMetaType > m_cacheMetaType
void reuseItem(QQmlDelegateModelItem *item, int newModelIndex, int newGroups)
void drainReusableItemsPool(int maxPoolTime)
QQmlDelegateModelGroup * m_persistedItems
static QQmlDelegateModelGroup * group_at(QQmlListProperty< QQmlDelegateModelGroup > *property, qsizetype index)
void itemsRemoved(const QList< Compositor::Remove > &removes, QVarLengthArray< QList< QQmlChangeSet::Change >, Compositor::MaximumGroupCount > *translatedRemoves, QHash< int, QList< QQmlDelegateModelItem * > > *movedItems=nullptr)
QQmlDelegateModelGroupEmitterList m_pendingParts
void emitModelUpdated(const QQmlChangeSet &changeSet, bool reset) override
QQmlDelegateModelGroup * m_cacheItems
QObject * object(Compositor::Group group, int index, QQmlIncubator::IncubationMode incubationMode)
void destroyCacheItem(QQmlDelegateModelItem *cacheItem)
void itemsRemoved(const QList< Compositor::Remove > &removes)
InsertionResult insert(Compositor::insert_iterator &before, const QV4::Value &object, int groups)
void setGroups(Compositor::iterator from, int count, Compositor::Group group, int groupFlags)
void delegateChanged(bool add=true, bool remove=true)
QQmlDelegateModelGroup * m_items
void releaseIncubator(QQDMIncubationTask *incubationTask)
void itemsInserted(const QList< Compositor::Insert > &inserts, QVarLengthArray< QList< QQmlChangeSet::Change >, Compositor::MaximumGroupCount > *translatedInserts, QHash< int, QList< QQmlDelegateModelItem * > > *movedItems=nullptr)
void incubatorStatusChanged(QQDMIncubationTask *incubationTask, QQmlIncubator::Status status)
void emitInitPackage(QQDMIncubationTask *incubationTask, QQuickPackage *package)
void addGroups(Compositor::iterator from, int count, Compositor::Group group, int groupFlags)
void emitDestroyingPackage(QQuickPackage *package)
QQmlComponent * resolveDelegate(int index)
QMetaObject::Connection m_delegateChooserChanged
QQmlDelegateModelGroup * m_groups[Compositor::MaximumGroupCount]
void removeGroups(Compositor::iterator from, int count, Compositor::Group group, int groupFlags)
void itemsChanged(const QList< Compositor::Change > &changes)
QQmlReusableDelegateModelItemsPool m_reusableItemsPool
QQmlListCompositor::Group m_compositorGroup
static QQmlDelegateModelPrivate * get(QQmlDelegateModel *m)
void emitModelUpdated(const QQmlChangeSet &changeSet, bool reset) override
QVariant variantValue(int index, const QString &role) override
int count() const override
QObject * object(int index, QQmlIncubator::IncubationMode incubationMode=QQmlIncubator::AsynchronousIfNested) override
QList< QByteArray > watchedRoles() const
void updateFilterGroup(Compositor::Group group, const QQmlChangeSet &changeSet)
void setFilterGroup(const QString &group)
QQmlIncubator::Status incubationStatus(int index) override
int indexOf(QObject *item, QObject *objectContext) const override
void destroyingPackage(QQuickPackage *package) override
void setWatchedRoles(const QList< QByteArray > &roles) override
ReleaseFlags release(QObject *item, ReusableFlag reusable=NotReusable) override
void createdPackage(int index, QQuickPackage *package) override
void initPackage(int index, QQuickPackage *package) override
QString filterGroup() const
bool isValid() const override
bool insertItem(QQmlDelegateModelItem *modelItem)
void reuseItem(QQmlDelegateModelItem *item, int newModelIndex)
void drain(int maxPoolTime, std::function< void(QQmlDelegateModelItem *cacheItem)> releaseItem)
QQmlDelegateModelItem * takeItem(const QQmlComponent *delegate, int newIndexHint)
Combined button and popup list for selecting options.
Definition qjsvalue.h:24
QT_REQUIRE_CONFIG(animation)
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQIORing)
QT_REQUIRE_CONFIG(qml_delegate_model)
static bool isDoneIncubating(QQmlIncubator::Status status)
DEFINE_OBJECT_VTABLE(QQmlDelegateModelGroupChange)
DEFINE_OBJECT_VTABLE(QV4::DelegateModelGroupFunction)
DEFINE_OBJECT_VTABLE(QQmlDelegateModelItemObject)
static void incrementIndexes(QQmlDelegateModelItem *cacheItem, int count, const int *deltas)
DEFINE_OBJECT_VTABLE(QQmlDelegateModelGroupChangeArray)
QQmlDelegateModelGroupEmitterList::iterator GroupEmitterListIt
QIntrusiveList< QQmlDelegateModelGroupEmitter, &QQmlDelegateModelGroupEmitter::emitterNode > QQmlDelegateModelGroupEmitterList
QT_BEGIN_NAMESPACE typedef QQmlListCompositor Compositor
void init(ExecutionEngine *engine, uint flag, QV4::ReturnedValue(*code)(QQmlDelegateModelItem *item, uint flag, const QV4::Value &arg))
QV4::ReturnedValue(* code)(QQmlDelegateModelItem *item, uint flag, const QV4::Value &arg)
void init(const QList< QQmlChangeSet::Change > &changes)
void init(QQmlDelegateModelItem *item)
std::byte ref[sizeof(QQmlDelegateModelItem::ScriptReference)]