OpenCoverage

qqmldelegatemodel_p_p.h

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/types/qqmldelegatemodel_p_p.h
Source codeSwitch to Preprocessed file
LineSourceCount
1/****************************************************************************-
2**-
3** Copyright (C) 2016 The Qt Company Ltd.-
4** Contact: https://www.qt.io/licensing/-
5**-
6** This file is part of the QtQml module of the Qt Toolkit.-
7**-
8** $QT_BEGIN_LICENSE:LGPL$-
9** Commercial License Usage-
10** Licensees holding valid commercial Qt licenses may use this file in-
11** accordance with the commercial license agreement provided with the-
12** Software or, alternatively, in accordance with the terms contained in-
13** a written agreement between you and The Qt Company. For licensing terms-
14** and conditions see https://www.qt.io/terms-conditions. For further-
15** information use the contact form at https://www.qt.io/contact-us.-
16**-
17** GNU Lesser General Public License Usage-
18** Alternatively, this file may be used under the terms of the GNU Lesser-
19** General Public License version 3 as published by the Free Software-
20** Foundation and appearing in the file LICENSE.LGPL3 included in the-
21** packaging of this file. Please review the following information to-
22** ensure the GNU Lesser General Public License version 3 requirements-
23** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.-
24**-
25** GNU General Public License Usage-
26** Alternatively, this file may be used under the terms of the GNU-
27** General Public License version 2.0 or (at your option) the GNU General-
28** Public license version 3 or any later version approved by the KDE Free-
29** Qt Foundation. The licenses are as published by the Free Software-
30** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3-
31** included in the packaging of this file. Please review the following-
32** information to ensure the GNU General Public License requirements will-
33** be met: https://www.gnu.org/licenses/gpl-2.0.html and-
34** https://www.gnu.org/licenses/gpl-3.0.html.-
35**-
36** $QT_END_LICENSE$-
37**-
38****************************************************************************/-
39-
40#ifndef QQMLDATAMODEL_P_P_H-
41#define QQMLDATAMODEL_P_P_H-
42-
43#include "qqmldelegatemodel_p.h"-
44#include <private/qv4qobjectwrapper_p.h>-
45-
46#include <QtQml/qqmlcontext.h>-
47#include <QtQml/qqmlincubator.h>-
48-
49#include <private/qqmladaptormodel_p.h>-
50#include <private/qqmlopenmetaobject_p.h>-
51-
52//-
53// W A R N I N G-
54// --------------
55//-
56// This file is not part of the Qt API. It exists purely as an-
57// implementation detail. This header file may change from version to-
58// version without notice, or even be removed.-
59//-
60// We mean it.-
61//-
62-
63QT_REQUIRE_CONFIG(qml_delegate_model);-
64-
65QT_BEGIN_NAMESPACE-
66-
67typedef QQmlListCompositor Compositor;-
68-
69class QQmlDelegateModelAttachedMetaObject;-
70-
71class QQmlDelegateModelItemMetaType : public QQmlRefCount-
72{-
73public:-
74 QQmlDelegateModelItemMetaType(QV4::ExecutionEngine *engine, QQmlDelegateModel *model, const QStringList &groupNames);-
75 ~QQmlDelegateModelItemMetaType();-
76-
77 void initializeMetaObject();-
78 void initializePrototype();-
79-
80 int parseGroups(const QStringList &groupNames) const;-
81 int parseGroups(const QV4::Value &groupNames) const;-
82-
83 QPointer<QQmlDelegateModel> model;-
84 const int groupCount;-
85 QV4::ExecutionEngine * const v4Engine;-
86 QQmlDelegateModelAttachedMetaObject *metaObject;-
87 const QStringList groupNames;-
88 QV4::PersistentValue modelItemProto;-
89};-
90-
91class QQmlAdaptorModel;-
92class QQDMIncubationTask;-
93-
94class QQmlDelegateModelItem : public QObject-
95{-
96 Q_OBJECT-
97 Q_PROPERTY(int index READ modelIndex NOTIFY modelIndexChanged)-
98 Q_PROPERTY(int row MEMBER row NOTIFY rowChanged)-
99 Q_PROPERTY(int column MEMBER column NOTIFY columnChanged)-
100 Q_PROPERTY(QObject *model READ modelObject CONSTANT)-
101public:-
102 QQmlDelegateModelItem(QQmlDelegateModelItemMetaType *metaType, int modelIndex);-
103 ~QQmlDelegateModelItem();-
104-
105 void referenceObject() { ++objectRef; }
executed 197626 times by 25 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_scenegraph
197626
106 bool releaseObject() { return --objectRef == 0 && !(groups & Compositor::PersistedFlag); }
executed 128450 times by 25 tests: return --objectRef == 0 && !(groups & Compositor::PersistedFlag);
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_scenegraph
128450
107 bool isObjectReferenced() const { return objectRef != 0 || (groups & Compositor::PersistedFlag); }
executed 88373 times by 25 tests: return objectRef != 0 || (groups & Compositor::PersistedFlag);
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_scenegraph
88373
108-
109 bool isReferenced() const {-
110 return scriptRef
executed 128503 times by 24 tests: return scriptRef || incubationTask || ((groups & Compositor::UnresolvedFlag) && (groups & Compositor::GroupMask));
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_scenegraph
128503
111 || incubationTask
executed 128503 times by 24 tests: return scriptRef || incubationTask || ((groups & Compositor::UnresolvedFlag) && (groups & Compositor::GroupMask));
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_scenegraph
128503
112 || ((groups & Compositor::UnresolvedFlag) && (groups & Compositor::GroupMask));
executed 128503 times by 24 tests: return scriptRef || incubationTask || ((groups & Compositor::UnresolvedFlag) && (groups & Compositor::GroupMask));
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_scenegraph
128503
113 }-
114-
115 void Dispose();-
116-
117 QObject *modelObject() { return this; }
executed 12494 times by 7 tests: return this;
Executed by:
  • tst_examples
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
12494
118-
119 void destroyObject();-
120-
121 static QQmlDelegateModelItem *dataForObject(QObject *object);-
122-
123 int groupIndex(Compositor::Group group);-
124-
125 int modelIndex() const { return index; }
executed 1401507 times by 17 tests: return index;
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickdraghandler
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
  • tst_scenegraph
1401507
126 virtual void setModelIndex(int idx);-
127-
128 virtual QV4::ReturnedValue get() { return QV4::QObjectWrapper::wrap(v4, this); }
executed 96 times by 1 test: return QV4::QObjectWrapper::wrap(v4, this);
Executed by:
  • tst_qquickvisualdatamodel
96
129-
130 virtual void setValue(const QString &role, const QVariant &value) { Q_UNUSED(role); Q_UNUSED(value); }
never executed: end of block
0
131 virtual bool resolveIndex(const QQmlAdaptorModel &, int) { return false; }
never executed: return false;
0
132-
133 static QV4::ReturnedValue get_model(const QV4::FunctionObject *, const QV4::Value *thisObject, const QV4::Value *argv, int argc);-
134 static QV4::ReturnedValue get_groups(const QV4::FunctionObject *, const QV4::Value *thisObject, const QV4::Value *argv, int argc);-
135 static QV4::ReturnedValue set_groups(const QV4::FunctionObject *, const QV4::Value *thisObject, const QV4::Value *argv, int argc);-
136 static QV4::ReturnedValue get_member(QQmlDelegateModelItem *thisItem, uint flag, const QV4::Value &);-
137 static QV4::ReturnedValue set_member(QQmlDelegateModelItem *thisItem, uint flag, const QV4::Value &arg);-
138 static QV4::ReturnedValue get_index(QQmlDelegateModelItem *thisItem, uint flag, const QV4::Value &arg);-
139-
140 QV4::ExecutionEngine *v4;-
141 QQmlDelegateModelItemMetaType * const metaType;-
142 QQmlContextDataRef contextData;-
143 QPointer<QObject> object;-
144 QPointer<QQmlDelegateModelAttached> attached;-
145 QQDMIncubationTask *incubationTask;-
146 int objectRef;-
147 int scriptRef;-
148 int groups;-
149 int index;-
150-
151Q_SIGNALS:-
152 void modelIndexChanged();-
153 void rowChanged();-
154 void columnChanged();-
155-
156protected:-
157 void objectDestroyed(QObject *);-
158 int row;-
159 int column;-
160};-
161-
162namespace QV4 {-
163namespace Heap {-
164struct QQmlDelegateModelItemObject : Object {-
165 inline void init(QQmlDelegateModelItem *item);-
166 void destroy();-
167 QQmlDelegateModelItem *item;-
168};-
169-
170}-
171}-
172-
173struct QQmlDelegateModelItemObject : QV4::Object-
174{-
175 V4_OBJECT2(QQmlDelegateModelItemObject, QV4::Object)
executed 32106 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickvisualdatamodel
never executed: end of block
executed 128004 times by 2 tests: return &static_vtbl;
Executed by:
  • tst_examples
  • tst_qquickvisualdatamodel
executed 115950 times by 2 tests: return static_cast<QV4::Heap::QQmlDelegateModelItemObject *>(m());
Executed by:
  • tst_examples
  • tst_qquickvisualdatamodel
executed 83984 times by 2 tests: return dptr;
Executed by:
  • tst_examples
  • tst_qquickvisualdatamodel
0-128004
176 V4_NEEDS_DESTROY
executed 31966 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickvisualdatamodel
31966
177};-
178-
179void QV4::Heap::QQmlDelegateModelItemObject::init(QQmlDelegateModelItem *item)-
180{-
181 Object::init();-
182 this->item = item;-
183}
executed 31966 times by 2 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickvisualdatamodel
31966
184-
185-
186-
187class QQmlDelegateModelPrivate;-
188class QQDMIncubationTask : public QQmlIncubator-
189{-
190public:-
191 QQDMIncubationTask(QQmlDelegateModelPrivate *l, IncubationMode mode)-
192 : QQmlIncubator(mode)-
193 , incubating(nullptr)-
194 , vdm(l) {}
executed 88407 times by 25 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_scenegraph
88407
195-
196 void statusChanged(Status) override;-
197 void setInitialState(QObject *) override;-
198-
199 QQmlDelegateModelItem *incubating;-
200 QQmlDelegateModelPrivate *vdm;-
201 int index[QQmlListCompositor::MaximumGroupCount];-
202};-
203-
204-
205class QQmlDelegateModelGroupEmitter-
206{-
207public:-
208 virtual ~QQmlDelegateModelGroupEmitter() {}-
209 virtual void emitModelUpdated(const QQmlChangeSet &changeSet, bool reset) = 0;-
210 virtual void createdPackage(int, QQuickPackage *) {}-
211 virtual void initPackage(int, QQuickPackage *) {}-
212 virtual void destroyingPackage(QQuickPackage *) {}-
213-
214 QIntrusiveListNode emitterNode;-
215};-
216-
217typedef QIntrusiveList<QQmlDelegateModelGroupEmitter, &QQmlDelegateModelGroupEmitter::emitterNode> QQmlDelegateModelGroupEmitterList;-
218-
219class QQmlDelegateModelGroupPrivate : public QObjectPrivate-
220{-
221public:-
222 Q_DECLARE_PUBLIC(QQmlDelegateModelGroup)-
223-
224 QQmlDelegateModelGroupPrivate() : group(Compositor::Cache), defaultInclude(false) {}
executed 12322 times by 27 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • tst_qquicktableview
  • tst_qquickvisualdatamodel
  • ...
12322
225-
226 static QQmlDelegateModelGroupPrivate *get(QQmlDelegateModelGroup *group) {-
227 return static_cast<QQmlDelegateModelGroupPrivate *>(QObjectPrivate::get(group)); }
executed 176548 times by 27 tests: return static_cast<QQmlDelegateModelGroupPrivate *>(QObjectPrivate::get(group));
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • tst_qquicktableview
  • tst_qquickvisualdatamodel
  • ...
176548
228-
229 void setModel(QQmlDelegateModel *model, Compositor::Group group);-
230 bool isChangedConnected();-
231 void emitChanges(QV4::ExecutionEngine *engine);-
232 void emitModelUpdated(bool reset);-
233-
234 void createdPackage(int index, QQuickPackage *package);-
235 void initPackage(int index, QQuickPackage *package);-
236 void destroyingPackage(QQuickPackage *package);-
237-
238 bool parseIndex(const QV4::Value &value, int *index, Compositor::Group *group) const;-
239 bool parseGroupArgs(-
240 QQmlV4Function *args, Compositor::Group *group, int *index, int *count, int *groups) const;-
241-
242 Compositor::Group group;-
243 QPointer<QQmlDelegateModel> model;-
244 QQmlDelegateModelGroupEmitterList emitters;-
245 QQmlChangeSet changeSet;-
246 QString name;-
247 bool defaultInclude;-
248};-
249-
250class QQmlDelegateModelParts;-
251-
252class QQmlDelegateModelPrivate : public QObjectPrivate, public QQmlDelegateModelGroupEmitter-
253{-
254 Q_DECLARE_PUBLIC(QQmlDelegateModel)-
255public:-
256 QQmlDelegateModelPrivate(QQmlContext *);-
257 ~QQmlDelegateModelPrivate();-
258-
259 static QQmlDelegateModelPrivate *get(QQmlDelegateModel *m) {-
260 return static_cast<QQmlDelegateModelPrivate *>(QObjectPrivate::get(m));
executed 373692 times by 27 tests: return static_cast<QQmlDelegateModelPrivate *>(QObjectPrivate::get(m));
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • tst_qquicktableview
  • tst_qquickvisualdatamodel
  • ...
373692
261 }-
262-
263 void init();-
264 void connectModel(QQmlAdaptorModel *model);-
265-
266 void requestMoreIfNecessary();-
267 QObject *object(Compositor::Group group, int index, QQmlIncubator::IncubationMode incubationMode);-
268 QQmlDelegateModel::ReleaseFlags release(QObject *object);-
269 QString stringValue(Compositor::Group group, int index, const QString &name);-
270 void emitCreatedPackage(QQDMIncubationTask *incubationTask, QQuickPackage *package);-
271 void emitInitPackage(QQDMIncubationTask *incubationTask, QQuickPackage *package);-
272 void emitCreatedItem(QQDMIncubationTask *incubationTask, QObject *item) {-
273 Q_EMIT q_func()->createdItem(incubationTask->index[m_compositorGroup], item); }
executed 83359 times by 25 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_scenegraph
83359
274 void emitInitItem(QQDMIncubationTask *incubationTask, QObject *item) {-
275 Q_EMIT q_func()->initItem(incubationTask->index[m_compositorGroup], item); }
executed 83359 times by 25 tests: end of block
Executed by:
  • tst_examples
  • tst_multipointtoucharea_interop
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmlqt
  • tst_qqmltypeloader
  • tst_qqmlvaluetypes
  • tst_qquickanimations
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquickitemparticle
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickshortcut
  • tst_qquickspringanimation
  • tst_qquickvisualdatamodel
  • tst_scenegraph
83359
276 void emitDestroyingPackage(QQuickPackage *package);-
277 void emitDestroyingItem(QObject *item) { Q_EMIT q_func()->destroyingItem(item); }
executed 22297 times by 12 tests: end of block
Executed by:
  • tst_qqmlecmascript
  • tst_qqmlinstantiator
  • tst_qqmlqt
  • tst_qquickgridview
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickpathview
  • tst_qquickpositioners
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
22297
278 void addCacheItem(QQmlDelegateModelItem *item, Compositor::iterator it);-
279 void removeCacheItem(QQmlDelegateModelItem *cacheItem);-
280-
281 void updateFilterGroup();-
282-
283 void addGroups(Compositor::iterator from, int count, Compositor::Group group, int groupFlags);-
284 void removeGroups(Compositor::iterator from, int count, Compositor::Group group, int groupFlags);-
285 void setGroups(Compositor::iterator from, int count, Compositor::Group group, int groupFlags);-
286-
287 void itemsInserted(-
288 const QVector<Compositor::Insert> &inserts,-
289 QVarLengthArray<QVector<QQmlChangeSet::Change>, Compositor::MaximumGroupCount> *translatedInserts,-
290 QHash<int, QList<QQmlDelegateModelItem *> > *movedItems = nullptr);-
291 void itemsInserted(const QVector<Compositor::Insert> &inserts);-
292 void itemsRemoved(-
293 const QVector<Compositor::Remove> &removes,-
294 QVarLengthArray<QVector<QQmlChangeSet::Change>, Compositor::MaximumGroupCount> *translatedRemoves,-
295 QHash<int, QList<QQmlDelegateModelItem *> > *movedItems = nullptr);-
296 void itemsRemoved(const QVector<Compositor::Remove> &removes);-
297 void itemsMoved(-
298 const QVector<Compositor::Remove> &removes, const QVector<Compositor::Insert> &inserts);-
299 void itemsChanged(const QVector<Compositor::Change> &changes);-
300 void emitChanges();-
301 void emitModelUpdated(const QQmlChangeSet &changeSet, bool reset) override;-
302-
303 bool insert(Compositor::insert_iterator &before, const QV4::Value &object, int groups);-
304-
305 int adaptorModelCount() const;-
306-
307 static void group_append(QQmlListProperty<QQmlDelegateModelGroup> *property, QQmlDelegateModelGroup *group);-
308 static int group_count(QQmlListProperty<QQmlDelegateModelGroup> *property);-
309 static QQmlDelegateModelGroup *group_at(QQmlListProperty<QQmlDelegateModelGroup> *property, int index);-
310-
311 void releaseIncubator(QQDMIncubationTask *incubationTask);-
312 void incubatorStatusChanged(QQDMIncubationTask *incubationTask, QQmlIncubator::Status status);-
313 void setInitialState(QQDMIncubationTask *incubationTask, QObject *o);-
314-
315 QQmlAdaptorModel m_adaptorModel;-
316 QQmlListCompositor m_compositor;-
317 QQmlStrongJSQObjectReference<QQmlComponent> m_delegate;-
318 QQmlDelegateModelItemMetaType *m_cacheMetaType;-
319 QPointer<QQmlContext> m_context;-
320 QQmlDelegateModelParts *m_parts;-
321 QQmlDelegateModelGroupEmitterList m_pendingParts;-
322-
323 QList<QQmlDelegateModelItem *> m_cache;-
324 QList<QQDMIncubationTask *> m_finishedIncubating;-
325 QList<QByteArray> m_watchedRoles;-
326-
327 QString m_filterGroup;-
328-
329 int m_count;-
330 int m_groupCount;-
331-
332 QQmlListCompositor::Group m_compositorGroup;-
333 bool m_complete : 1;-
334 bool m_delegateValidated : 1;-
335 bool m_reset : 1;-
336 bool m_transaction : 1;-
337 bool m_incubatorCleanupScheduled : 1;-
338 bool m_waitingToFetchMore : 1;-
339 bool m_useFirstColumnOnly : 1;-
340-
341 union {-
342 struct {-
343 QQmlDelegateModelGroup *m_cacheItems;-
344 QQmlDelegateModelGroup *m_items;-
345 QQmlDelegateModelGroup *m_persistedItems;-
346 };-
347 QQmlDelegateModelGroup *m_groups[Compositor::MaximumGroupCount];-
348 };-
349};-
350-
351class QQmlPartsModel : public QQmlInstanceModel, public QQmlDelegateModelGroupEmitter-
352{-
353 Q_OBJECT-
354 Q_PROPERTY(QString filterOnGroup READ filterGroup WRITE setFilterGroup NOTIFY filterGroupChanged RESET resetFilterGroup)-
355public:-
356 QQmlPartsModel(QQmlDelegateModel *model, const QString &part, QObject *parent = nullptr);-
357 ~QQmlPartsModel();-
358-
359 QString filterGroup() const;-
360 void setFilterGroup(const QString &group);-
361 void resetFilterGroup();-
362 void updateFilterGroup();-
363 void updateFilterGroup(Compositor::Group group, const QQmlChangeSet &changeSet);-
364-
365 int count() const override;-
366 bool isValid() const override;-
367 QObject *object(int index, QQmlIncubator::IncubationMode incubationMode = QQmlIncubator::AsynchronousIfNested) override;-
368 ReleaseFlags release(QObject *item) override;-
369 QString stringValue(int index, const QString &role) override;-
370 QList<QByteArray> watchedRoles() const { return m_watchedRoles; }
executed 146 times by 5 tests: return m_watchedRoles;
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickvisualdatamodel
146
371 void setWatchedRoles(const QList<QByteArray> &roles) override;-
372 QQmlIncubator::Status incubationStatus(int index) override;-
373-
374 int indexOf(QObject *item, QObject *objectContext) const override;-
375-
376 void emitModelUpdated(const QQmlChangeSet &changeSet, bool reset) override;-
377-
378 void createdPackage(int index, QQuickPackage *package) override;-
379 void initPackage(int index, QQuickPackage *package) override;-
380 void destroyingPackage(QQuickPackage *package) override;-
381-
382Q_SIGNALS:-
383 void filterGroupChanged();-
384-
385private:-
386 QQmlDelegateModel *m_model;-
387 QHash<QObject *, QQuickPackage *> m_packaged;-
388 QString m_part;-
389 QString m_filterGroup;-
390 QList<QByteArray> m_watchedRoles;-
391 QVector<int> m_pendingPackageInitializations; // vector holds model indices-
392 Compositor::Group m_compositorGroup;-
393 bool m_inheritGroup;-
394 bool m_modelUpdatePending = true;-
395};-
396-
397class QMetaPropertyBuilder;-
398-
399class QQmlDelegateModelPartsMetaObject : public QQmlOpenMetaObject-
400{-
401public:-
402 QQmlDelegateModelPartsMetaObject(QObject *parent)-
403 : QQmlOpenMetaObject(parent) {}
executed 352 times by 6 tests: end of block
Executed by:
  • tst_examples
  • tst_qquickgridview
  • tst_qquicklistview
  • tst_qquickpathview
  • tst_qquickrepeater
  • tst_qquickvisualdatamodel
352
404-
405 void propertyCreated(int, QMetaPropertyBuilder &) override;-
406 QVariant initialValue(int) override;-
407};-
408-
409class QQmlDelegateModelParts : public QObject-
410{-
411Q_OBJECT-
412public:-
413 QQmlDelegateModelParts(QQmlDelegateModel *parent);-
414-
415 QQmlDelegateModel *model;-
416 QList<QQmlPartsModel *> models;-
417};-
418-
419class QQmlDelegateModelAttachedMetaObject : public QAbstractDynamicMetaObject, public QQmlRefCount-
420{-
421public:-
422 QQmlDelegateModelAttachedMetaObject(-
423 QQmlDelegateModelItemMetaType *metaType, QMetaObject *metaObject);-
424 ~QQmlDelegateModelAttachedMetaObject();-
425-
426 void objectDestroyed(QObject *) override;-
427 int metaCall(QObject *, QMetaObject::Call, int _id, void **) override;-
428-
429private:-
430 QQmlDelegateModelItemMetaType * const metaType;-
431 QMetaObject * const metaObject;-
432 const int memberPropertyOffset;-
433 const int indexPropertyOffset;-
434};-
435-
436QT_END_NAMESPACE-
437-
438#endif-
Source codeSwitch to Preprocessed file

Generated by Squish Coco 4.2.0