| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/types/qqmldelegatemodel.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||||||||
| 2 | - | |||||||||||||||||||||||||
| 3 | - | |||||||||||||||||||||||||
| 4 | - | |||||||||||||||||||||||||
| 5 | - | |||||||||||||||||||||||||
| 6 | - | |||||||||||||||||||||||||
| 7 | class QQmlDelegateModelItem; | - | ||||||||||||||||||||||||
| 8 | - | |||||||||||||||||||||||||
| 9 | namespace QV4 { | - | ||||||||||||||||||||||||
| 10 | - | |||||||||||||||||||||||||
| 11 | namespace Heap { | - | ||||||||||||||||||||||||
| 12 | - | |||||||||||||||||||||||||
| 13 | struct DelegateModelGroupFunction : FunctionObject { | - | ||||||||||||||||||||||||
| 14 | void init(QV4::ExecutionContext *scope, uint flag, QV4::ReturnedValue (*code)(QQmlDelegateModelItem *item, uint flag, const QV4::Value &arg)); | - | ||||||||||||||||||||||||
| 15 | - | |||||||||||||||||||||||||
| 16 | QV4::ReturnedValue (*code)(QQmlDelegateModelItem *item, uint flag, const QV4::Value &arg); | - | ||||||||||||||||||||||||
| 17 | uint flag; | - | ||||||||||||||||||||||||
| 18 | }; | - | ||||||||||||||||||||||||
| 19 | - | |||||||||||||||||||||||||
| 20 | struct QQmlDelegateModelGroupChange : Object { | - | ||||||||||||||||||||||||
| 21 | void init() { Object::init(); } executed 166 times by 1 test: end of blockExecuted by:
| 166 | ||||||||||||||||||||||||
| 22 | - | |||||||||||||||||||||||||
| 23 | QQmlChangeSet::ChangeData change; | - | ||||||||||||||||||||||||
| 24 | }; | - | ||||||||||||||||||||||||
| 25 | - | |||||||||||||||||||||||||
| 26 | struct QQmlDelegateModelGroupChangeArray : Object { | - | ||||||||||||||||||||||||
| 27 | void init(const QVector<QQmlChangeSet::Change> &changes); | - | ||||||||||||||||||||||||
| 28 | void destroy() { | - | ||||||||||||||||||||||||
| 29 | delete changes; | - | ||||||||||||||||||||||||
| 30 | Object::destroy(); | - | ||||||||||||||||||||||||
| 31 | } executed 164 times by 2 tests: end of blockExecuted by:
| 164 | ||||||||||||||||||||||||
| 32 | - | |||||||||||||||||||||||||
| 33 | QVector<QQmlChangeSet::Change> *changes; | - | ||||||||||||||||||||||||
| 34 | }; | - | ||||||||||||||||||||||||
| 35 | - | |||||||||||||||||||||||||
| 36 | - | |||||||||||||||||||||||||
| 37 | } | - | ||||||||||||||||||||||||
| 38 | - | |||||||||||||||||||||||||
| 39 | struct DelegateModelGroupFunction : QV4::FunctionObject | - | ||||||||||||||||||||||||
| 40 | { | - | ||||||||||||||||||||||||
| 41 | private: DelegateModelGroupFunction() = delete; DelegateModelGroupFunction(const DelegateModelGroupFunction &) = delete; DelegateModelGroupFunction &operator=(const DelegateModelGroupFunction &) = delete; public: template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; } never executed: typedef QV4::Heap::DelegateModelGroupFunction Data; typedef FunctionObject SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blockexecuted 16290 times by 2 tests: &static_vtbl;return &static_vtbl;Executed by:
executed 16290 times by 2 tests: } void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }return &static_vtbl;Executed by:
never executed: QV4::Heap::DelegateModelGroupFunction *d_unchecked() const { returnend of blockexecuted 51424 times by 2 tests: static_cast<QV4::Heap::DelegateModelGroupFunction *>(m());return static_cast<QV4::Heap::DelegateModelGroupFunction *>(m());Executed by:
executed 51424 times by 2 tests: } QV4::Heap::DelegateModelGroupFunction *d() const { QV4::Heap::DelegateModelGroupFunction *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::DelegateModelGroupFunction *>(m());Executed by:
executed 45994 times by 2 tests: dptr;return dptr;Executed by:
executed 45994 times by 2 tests: } static_assert(bool(std::is_trivial< QV4::Heap::DelegateModelGroupFunction >::value), "std::is_trivial< QV4::Heap::DelegateModelGroupFunction >::value");return dptr;Executed by:
| 0-51424 | ||||||||||||||||||||||||
| 42 | - | |||||||||||||||||||||||||
| 43 | static Heap::DelegateModelGroupFunction *create(QV4::ExecutionContext *scope, uint flag, QV4::ReturnedValue (*code)(QQmlDelegateModelItem *item, uint flag, const QV4::Value &arg)) | - | ||||||||||||||||||||||||
| 44 | { | - | ||||||||||||||||||||||||
| 45 | return executed 5430 times by 2 tests: scope->engine()->memoryManager->allocate<DelegateModelGroupFunction>(scope, flag, code);return scope->engine()->memoryManager->allocate<DelegateModelGroupFunction>(scope, flag, code);Executed by:
executed 5430 times by 2 tests: return scope->engine()->memoryManager->allocate<DelegateModelGroupFunction>(scope, flag, code);Executed by:
| 5430 | ||||||||||||||||||||||||
| 46 | } | - | ||||||||||||||||||||||||
| 47 | - | |||||||||||||||||||||||||
| 48 | static ReturnedValue virtualCall(const QV4::FunctionObject *that, const Value *thisObject, const Value *argv, int argc) | - | ||||||||||||||||||||||||
| 49 | { | - | ||||||||||||||||||||||||
| 50 | QV4::Scope scope(that->engine()); | - | ||||||||||||||||||||||||
| 51 | QV4::Scoped<DelegateModelGroupFunction> f(scope, static_cast<const DelegateModelGroupFunction *>(that)); | - | ||||||||||||||||||||||||
| 52 | QV4::Scoped<QQmlDelegateModelItemObject> o(scope, thisObject); | - | ||||||||||||||||||||||||
| 53 | if (!o
| 0-20282 | ||||||||||||||||||||||||
| 54 | return never executed: scope.engine->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Not a valid VisualData object")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Not a valid VisualData object" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn scope.engine->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Not a valid VisualData object")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Not a valid VisualData object" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()));return qstring_literal_temp;never executed: return scope.engine->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Not a valid VisualData object")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Not a valid VisualData object" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())); | 0 | ||||||||||||||||||||||||
| 55 | - | |||||||||||||||||||||||||
| 56 | QV4::ScopedValue v(scope, argc ? argv[0] : Primitive::undefinedValue()); | - | ||||||||||||||||||||||||
| 57 | return executed 20282 times by 2 tests: f->d()->code(o->d()->item, f->d()->flag, v);return f->d()->code(o->d()->item, f->d()->flag, v);Executed by:
executed 20282 times by 2 tests: return f->d()->code(o->d()->item, f->d()->flag, v);Executed by:
| 20282 | ||||||||||||||||||||||||
| 58 | } | - | ||||||||||||||||||||||||
| 59 | }; | - | ||||||||||||||||||||||||
| 60 | - | |||||||||||||||||||||||||
| 61 | void Heap::DelegateModelGroupFunction::init(QV4::ExecutionContext *scope, uint flag, QV4::ReturnedValue (*code)(QQmlDelegateModelItem *item, uint flag, const QV4::Value &arg)) | - | ||||||||||||||||||||||||
| 62 | { | - | ||||||||||||||||||||||||
| 63 | QV4::Heap::FunctionObject::init(scope, ([]() noexcept -> QString { enum { Size = sizeof(u"" "DelegateModelGroupFunction")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "DelegateModelGroupFunction" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 5430 times by 2 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 5430 times by 2 tests: }()));return qstring_literal_temp;Executed by:
| 5430 | ||||||||||||||||||||||||
| 64 | this->flag = flag; | - | ||||||||||||||||||||||||
| 65 | this->code = code; | - | ||||||||||||||||||||||||
| 66 | } executed 5430 times by 2 tests: end of blockExecuted by:
| 5430 | ||||||||||||||||||||||||
| 67 | - | |||||||||||||||||||||||||
| 68 | } | - | ||||||||||||||||||||||||
| 69 | - | |||||||||||||||||||||||||
| 70 | const QV4::VTable QV4::DelegateModelGroupFunction::static_vtbl = { (std::is_same<QV4::DelegateModelGroupFunction::SuperClass, Object>::value) ? nullptr : &QV4::DelegateModelGroupFunction::SuperClass::static_vtbl, (sizeof(QV4::DelegateModelGroupFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(QV4::DelegateModelGroupFunction::Data) + (QV4::DelegateModelGroupFunction::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(QV4::DelegateModelGroupFunction::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), QV4::DelegateModelGroupFunction::IsExecutionContext, QV4::DelegateModelGroupFunction::IsString, QV4::DelegateModelGroupFunction::IsObject, QV4::DelegateModelGroupFunction::IsFunctionObject, QV4::DelegateModelGroupFunction::IsErrorObject, QV4::DelegateModelGroupFunction::IsArrayData, QV4::DelegateModelGroupFunction::IsStringOrSymbol, QV4::DelegateModelGroupFunction::MyType, { 0, 0, 0, 0 }, "QV4::DelegateModelGroupFunction", QV4::DelegateModelGroupFunction::virtualDestroy, QV4::DelegateModelGroupFunction::Data::markObjects, QV4::DelegateModelGroupFunction::virtualIsEqualTo, QV4::DelegateModelGroupFunction::virtualGet, QV4::DelegateModelGroupFunction::virtualPut, QV4::DelegateModelGroupFunction::virtualDeleteProperty, QV4::DelegateModelGroupFunction::virtualHasProperty, QV4::DelegateModelGroupFunction::virtualGetOwnProperty, QV4::DelegateModelGroupFunction::virtualDefineOwnProperty, QV4::DelegateModelGroupFunction::virtualIsExtensible, QV4::DelegateModelGroupFunction::virtualPreventExtensions, QV4::DelegateModelGroupFunction::virtualGetPrototypeOf, QV4::DelegateModelGroupFunction::virtualSetPrototypeOf, QV4::DelegateModelGroupFunction::virtualGetLength, QV4::DelegateModelGroupFunction::virtualAdvanceIterator, QV4::DelegateModelGroupFunction::virtualInstanceOf, QV4::DelegateModelGroupFunction::virtualCall, QV4::DelegateModelGroupFunction::virtualCallAsConstructor, }; | - | ||||||||||||||||||||||||
| 71 | - | |||||||||||||||||||||||||
| 72 | - | |||||||||||||||||||||||||
| 73 | - | |||||||||||||||||||||||||
| 74 | class QQmlDelegateModelEngineData : public QV8Engine::Deletable | - | ||||||||||||||||||||||||
| 75 | { | - | ||||||||||||||||||||||||
| 76 | public: | - | ||||||||||||||||||||||||
| 77 | QQmlDelegateModelEngineData(QV4::ExecutionEngine *v4); | - | ||||||||||||||||||||||||
| 78 | ~QQmlDelegateModelEngineData(); | - | ||||||||||||||||||||||||
| 79 | - | |||||||||||||||||||||||||
| 80 | QV4::ReturnedValue array(QV4::ExecutionEngine *engine, | - | ||||||||||||||||||||||||
| 81 | const QVector<QQmlChangeSet::Change> &changes); | - | ||||||||||||||||||||||||
| 82 | - | |||||||||||||||||||||||||
| 83 | QV4::PersistentValue changeProto; | - | ||||||||||||||||||||||||
| 84 | }; | - | ||||||||||||||||||||||||
| 85 | - | |||||||||||||||||||||||||
| 86 | static inline QQmlDelegateModelEngineData *engineData(QV4::ExecutionEngine *engine) { static int extensionId = -1; if (extensionId == -1
executed 4 times by 2 tests: QV8Engine::registrationMutex()->unlock(); }extensionId = QV8Engine::registerExtension();Executed by:
executed 4 times by 2 tests: QQmlDelegateModelEngineData *rv = (QQmlDelegateModelEngineData *)engine->v8Engine->extensionData(extensionId); if (!rvend of blockExecuted by:
executed 4 times by 2 tests: returnend of blockExecuted by:
executed 330 times by 2 tests: rv;return rv;Executed by:
executed 330 times by 2 tests: }return rv;Executed by:
| 0-330 | ||||||||||||||||||||||||
| 87 | - | |||||||||||||||||||||||||
| 88 | - | |||||||||||||||||||||||||
| 89 | void QQmlDelegateModelPartsMetaObject::propertyCreated(int, QMetaPropertyBuilder &prop) | - | ||||||||||||||||||||||||
| 90 | { | - | ||||||||||||||||||||||||
| 91 | prop.setWritable(false); | - | ||||||||||||||||||||||||
| 92 | } executed 368 times by 6 tests: end of blockExecuted by:
| 368 | ||||||||||||||||||||||||
| 93 | - | |||||||||||||||||||||||||
| 94 | QVariant QQmlDelegateModelPartsMetaObject::initialValue(int id) | - | ||||||||||||||||||||||||
| 95 | { | - | ||||||||||||||||||||||||
| 96 | QQmlDelegateModelParts *parts = static_cast<QQmlDelegateModelParts *>(object()); | - | ||||||||||||||||||||||||
| 97 | QQmlPartsModel *m = new QQmlPartsModel( | - | ||||||||||||||||||||||||
| 98 | parts->model, QString::fromUtf8(name(id)), parts); | - | ||||||||||||||||||||||||
| 99 | parts->models.append(m); | - | ||||||||||||||||||||||||
| 100 | return executed 368 times by 6 tests: QVariant::fromValue(static_cast<QObject *>(m));return QVariant::fromValue(static_cast<QObject *>(m));Executed by:
executed 368 times by 6 tests: return QVariant::fromValue(static_cast<QObject *>(m));Executed by:
| 368 | ||||||||||||||||||||||||
| 101 | } | - | ||||||||||||||||||||||||
| 102 | - | |||||||||||||||||||||||||
| 103 | QQmlDelegateModelParts::QQmlDelegateModelParts(QQmlDelegateModel *parent) | - | ||||||||||||||||||||||||
| 104 | : QObject(parent), model(parent) | - | ||||||||||||||||||||||||
| 105 | { | - | ||||||||||||||||||||||||
| 106 | new QQmlDelegateModelPartsMetaObject(this); | - | ||||||||||||||||||||||||
| 107 | } executed 352 times by 6 tests: end of blockExecuted by:
| 352 | ||||||||||||||||||||||||
| 108 | QQmlDelegateModelPrivate::QQmlDelegateModelPrivate(QQmlContext *ctxt) | - | ||||||||||||||||||||||||
| 109 | : m_cacheMetaType(nullptr) | - | ||||||||||||||||||||||||
| 110 | , m_context(ctxt) | - | ||||||||||||||||||||||||
| 111 | , m_parts(nullptr) | - | ||||||||||||||||||||||||
| 112 | , m_filterGroup(([]() noexcept -> QString { enum { Size = sizeof(u"" "items")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "items" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())) | - | ||||||||||||||||||||||||
| 113 | , m_count(0) | - | ||||||||||||||||||||||||
| 114 | , m_groupCount(Compositor::MinimumGroupCount) | - | ||||||||||||||||||||||||
| 115 | , m_compositorGroup(Compositor::Cache) | - | ||||||||||||||||||||||||
| 116 | , m_complete(false) | - | ||||||||||||||||||||||||
| 117 | , m_delegateValidated(false) | - | ||||||||||||||||||||||||
| 118 | , m_reset(false) | - | ||||||||||||||||||||||||
| 119 | , m_transaction(false) | - | ||||||||||||||||||||||||
| 120 | , m_incubatorCleanupScheduled(false) | - | ||||||||||||||||||||||||
| 121 | , m_waitingToFetchMore(false) | - | ||||||||||||||||||||||||
| 122 | , m_useFirstColumnOnly(true) | - | ||||||||||||||||||||||||
| 123 | , m_cacheItems(nullptr) | - | ||||||||||||||||||||||||
| 124 | , m_items(nullptr) | - | ||||||||||||||||||||||||
| 125 | , m_persistedItems(nullptr) | - | ||||||||||||||||||||||||
| 126 | { | - | ||||||||||||||||||||||||
| 127 | } executed 5622 times by 27 tests: end of blockExecuted by:
| 5622 | ||||||||||||||||||||||||
| 128 | - | |||||||||||||||||||||||||
| 129 | QQmlDelegateModelPrivate::~QQmlDelegateModelPrivate() | - | ||||||||||||||||||||||||
| 130 | { | - | ||||||||||||||||||||||||
| 131 | qDeleteAll(m_finishedIncubating); | - | ||||||||||||||||||||||||
| 132 | - | |||||||||||||||||||||||||
| 133 | if (m_cacheMetaType
| 0-5556 | ||||||||||||||||||||||||
| 134 | m_cacheMetaType->release(); executed 5556 times by 25 tests: m_cacheMetaType->release();Executed by:
| 5556 | ||||||||||||||||||||||||
| 135 | } executed 5556 times by 25 tests: end of blockExecuted by:
| 5556 | ||||||||||||||||||||||||
| 136 | - | |||||||||||||||||||||||||
| 137 | int QQmlDelegateModelPrivate::adaptorModelCount() const | - | ||||||||||||||||||||||||
| 138 | { | - | ||||||||||||||||||||||||
| 139 | return executed 6348 times by 27 tests: m_useFirstColumnOnly ? m_adaptorModel.rowCount() : m_adaptorModel.count();return m_useFirstColumnOnly ? m_adaptorModel.rowCount() : m_adaptorModel.count();Executed by:
executed 6348 times by 27 tests: return m_useFirstColumnOnly ? m_adaptorModel.rowCount() : m_adaptorModel.count();Executed by:
| 6348 | ||||||||||||||||||||||||
| 140 | } | - | ||||||||||||||||||||||||
| 141 | - | |||||||||||||||||||||||||
| 142 | void QQmlDelegateModelPrivate::requestMoreIfNecessary() | - | ||||||||||||||||||||||||
| 143 | { | - | ||||||||||||||||||||||||
| 144 | QQmlDelegateModel * const q = q_func(); | - | ||||||||||||||||||||||||
| 145 | if (!m_waitingToFetchMore
| 2-14881 | ||||||||||||||||||||||||
| 146 | m_waitingToFetchMore = true; | - | ||||||||||||||||||||||||
| 147 | QCoreApplication::postEvent(q, new QEvent(QEvent::UpdateRequest)); | - | ||||||||||||||||||||||||
| 148 | } executed 18 times by 1 test: end of blockExecuted by:
| 18 | ||||||||||||||||||||||||
| 149 | } executed 14883 times by 27 tests: end of blockExecuted by:
| 14883 | ||||||||||||||||||||||||
| 150 | - | |||||||||||||||||||||||||
| 151 | void QQmlDelegateModelPrivate::init() | - | ||||||||||||||||||||||||
| 152 | { | - | ||||||||||||||||||||||||
| 153 | QQmlDelegateModel * const q = q_func(); | - | ||||||||||||||||||||||||
| 154 | m_compositor.setRemoveGroups(Compositor::GroupMask & ~Compositor::PersistedFlag); | - | ||||||||||||||||||||||||
| 155 | - | |||||||||||||||||||||||||
| 156 | m_items = new QQmlDelegateModelGroup(([]() noexcept -> QString { enum { Size = sizeof(u"" "items")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "items" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 5622 times by 27 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 5622 times by 27 tests: }()), q, Compositor::Default, q);return qstring_literal_temp;Executed by:
| 5622 | ||||||||||||||||||||||||
| 157 | m_items->setDefaultInclude(true); | - | ||||||||||||||||||||||||
| 158 | m_persistedItems = new QQmlDelegateModelGroup(([]() noexcept -> QString { enum { Size = sizeof(u"" "persistedItems")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "persistedItems" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 5622 times by 27 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 5622 times by 27 tests: }()), q, Compositor::Persisted, q);return qstring_literal_temp;Executed by:
| 5622 | ||||||||||||||||||||||||
| 159 | QQmlDelegateModelGroupPrivate::get(m_items)->emitters.insert(this); | - | ||||||||||||||||||||||||
| 160 | } executed 5622 times by 27 tests: end of blockExecuted by:
| 5622 | ||||||||||||||||||||||||
| 161 | - | |||||||||||||||||||||||||
| 162 | QQmlDelegateModel::QQmlDelegateModel() | - | ||||||||||||||||||||||||
| 163 | : QQmlDelegateModel(nullptr, nullptr) | - | ||||||||||||||||||||||||
| 164 | { | - | ||||||||||||||||||||||||
| 165 | } executed 760 times by 7 tests: end of blockExecuted by:
| 760 | ||||||||||||||||||||||||
| 166 | - | |||||||||||||||||||||||||
| 167 | QQmlDelegateModel::QQmlDelegateModel(QQmlContext *ctxt, QObject *parent) | - | ||||||||||||||||||||||||
| 168 | : QQmlInstanceModel(*(new QQmlDelegateModelPrivate(ctxt)), parent) | - | ||||||||||||||||||||||||
| 169 | { | - | ||||||||||||||||||||||||
| 170 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 171 | d->init(); | - | ||||||||||||||||||||||||
| 172 | } executed 5622 times by 27 tests: end of blockExecuted by:
| 5622 | ||||||||||||||||||||||||
| 173 | - | |||||||||||||||||||||||||
| 174 | QQmlDelegateModel::~QQmlDelegateModel() | - | ||||||||||||||||||||||||
| 175 | { | - | ||||||||||||||||||||||||
| 176 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 177 | d->m_adaptorModel.setObject(nullptr, this); | - | ||||||||||||||||||||||||
| 178 | - | |||||||||||||||||||||||||
| 179 | for (QQmlDelegateModelItem *cacheItem : qAsConst(d->m_cache)) { | - | ||||||||||||||||||||||||
| 180 | if (cacheItem->object
| 91-65876 | ||||||||||||||||||||||||
| 181 | delete cacheItem->object; | - | ||||||||||||||||||||||||
| 182 | - | |||||||||||||||||||||||||
| 183 | cacheItem->object = nullptr; | - | ||||||||||||||||||||||||
| 184 | cacheItem->contextData->invalidate(); | - | ||||||||||||||||||||||||
| 185 | ((cacheItem->contextData->refCount == 1) ? static_cast<void>(0) : qt_assert("cacheItem->contextData->refCount == 1", __FILE__, 279)); | - | ||||||||||||||||||||||||
| 186 | cacheItem->contextData = nullptr; | - | ||||||||||||||||||||||||
| 187 | cacheItem->scriptRef -= 1; | - | ||||||||||||||||||||||||
| 188 | } executed 65876 times by 23 tests: end of blockExecuted by:
| 65876 | ||||||||||||||||||||||||
| 189 | cacheItem->groups &= ~Compositor::UnresolvedFlag; | - | ||||||||||||||||||||||||
| 190 | cacheItem->objectRef = 0; | - | ||||||||||||||||||||||||
| 191 | if (!cacheItem->isReferenced()
| 2022-63945 | ||||||||||||||||||||||||
| 192 | delete cacheItem; executed 63945 times by 23 tests: delete cacheItem;Executed by:
| 63945 | ||||||||||||||||||||||||
| 193 | else if (cacheItem->incubationTask
| 36-1986 | ||||||||||||||||||||||||
| 194 | cacheItem->incubationTask->vdm = nullptr; executed 36 times by 2 tests: cacheItem->incubationTask->vdm = nullptr;Executed by:
| 36 | ||||||||||||||||||||||||
| 195 | } executed 65967 times by 23 tests: end of blockExecuted by:
| 65967 | ||||||||||||||||||||||||
| 196 | } executed 5556 times by 25 tests: end of blockExecuted by:
| 5556 | ||||||||||||||||||||||||
| 197 | - | |||||||||||||||||||||||||
| 198 | - | |||||||||||||||||||||||||
| 199 | void QQmlDelegateModel::classBegin() | - | ||||||||||||||||||||||||
| 200 | { | - | ||||||||||||||||||||||||
| 201 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 202 | if (!d->m_context
| 16-760 | ||||||||||||||||||||||||
| 203 | d->m_context = qmlContext(this); executed 760 times by 7 tests: d->m_context = qmlContext(this);Executed by:
| 760 | ||||||||||||||||||||||||
| 204 | } executed 776 times by 8 tests: end of blockExecuted by:
| 776 | ||||||||||||||||||||||||
| 205 | - | |||||||||||||||||||||||||
| 206 | void QQmlDelegateModel::componentComplete() | - | ||||||||||||||||||||||||
| 207 | { | - | ||||||||||||||||||||||||
| 208 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 209 | d->m_complete = true; | - | ||||||||||||||||||||||||
| 210 | - | |||||||||||||||||||||||||
| 211 | int defaultGroups = 0; | - | ||||||||||||||||||||||||
| 212 | QStringList groupNames; | - | ||||||||||||||||||||||||
| 213 | groupNames.append(([]() noexcept -> QString { enum { Size = sizeof(u"" "items")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "items" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 5622 times by 27 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 5622 times by 27 tests: }()));return qstring_literal_temp;Executed by:
| 5622 | ||||||||||||||||||||||||
| 214 | groupNames.append(([]() noexcept -> QString { enum { Size = sizeof(u"" "persistedItems")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "persistedItems" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 5622 times by 27 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 5622 times by 27 tests: }()));return qstring_literal_temp;Executed by:
| 5622 | ||||||||||||||||||||||||
| 215 | if (QQmlDelegateModelGroupPrivate::get(d->m_items)->defaultInclude
| 2-5620 | ||||||||||||||||||||||||
| 216 | defaultGroups |= Compositor::DefaultFlag; executed 5620 times by 27 tests: defaultGroups |= Compositor::DefaultFlag;Executed by:
| 5620 | ||||||||||||||||||||||||
| 217 | if (QQmlDelegateModelGroupPrivate::get(d->m_persistedItems)->defaultInclude
| 2-5620 | ||||||||||||||||||||||||
| 218 | defaultGroups |= Compositor::PersistedFlag; executed 2 times by 1 test: defaultGroups |= Compositor::PersistedFlag;Executed by:
| 2 | ||||||||||||||||||||||||
| 219 | for (int i = Compositor::MinimumGroupCount; i < d->m_groupCount
| 1076-5622 | ||||||||||||||||||||||||
| 220 | QString name = d->m_groups[i]->name(); | - | ||||||||||||||||||||||||
| 221 | if (name.isEmpty()
| 2-1074 | ||||||||||||||||||||||||
| 222 | d->m_groups[i] = d->m_groups[d->m_groupCount - 1]; | - | ||||||||||||||||||||||||
| 223 | --d->m_groupCount; | - | ||||||||||||||||||||||||
| 224 | --i; | - | ||||||||||||||||||||||||
| 225 | } executed 2 times by 1 test: else if (name.at(0).isUpper()end of blockExecuted by:
| 2-1072 | ||||||||||||||||||||||||
| 226 | qmlWarning(d->m_groups[i]) << QQmlDelegateModelGroup::tr("Group names must start with a lower case letter"); | - | ||||||||||||||||||||||||
| 227 | d->m_groups[i] = d->m_groups[d->m_groupCount - 1]; | - | ||||||||||||||||||||||||
| 228 | --d->m_groupCount; | - | ||||||||||||||||||||||||
| 229 | --i; | - | ||||||||||||||||||||||||
| 230 | } executed 2 times by 1 test: else {end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 231 | groupNames.append(name); | - | ||||||||||||||||||||||||
| 232 | - | |||||||||||||||||||||||||
| 233 | QQmlDelegateModelGroupPrivate *group = QQmlDelegateModelGroupPrivate::get(d->m_groups[i]); | - | ||||||||||||||||||||||||
| 234 | group->setModel(this, Compositor::Group(i)); | - | ||||||||||||||||||||||||
| 235 | if (group->defaultInclude
| 536 | ||||||||||||||||||||||||
| 236 | defaultGroups |= (1 << i); executed 536 times by 2 tests: defaultGroups |= (1 << i);Executed by:
| 536 | ||||||||||||||||||||||||
| 237 | } executed 1072 times by 2 tests: end of blockExecuted by:
| 1072 | ||||||||||||||||||||||||
| 238 | } | - | ||||||||||||||||||||||||
| 239 | - | |||||||||||||||||||||||||
| 240 | d->m_cacheMetaType = new QQmlDelegateModelItemMetaType( | - | ||||||||||||||||||||||||
| 241 | d->m_context->engine()->handle(), this, groupNames); | - | ||||||||||||||||||||||||
| 242 | - | |||||||||||||||||||||||||
| 243 | d->m_compositor.setGroupCount(d->m_groupCount); | - | ||||||||||||||||||||||||
| 244 | d->m_compositor.setDefaultGroups(defaultGroups); | - | ||||||||||||||||||||||||
| 245 | d->updateFilterGroup(); | - | ||||||||||||||||||||||||
| 246 | - | |||||||||||||||||||||||||
| 247 | while (!d->m_pendingParts.isEmpty()
| 0-5622 | ||||||||||||||||||||||||
| 248 | static_cast< never executed: QQmlPartsModel *>(d->m_pendingParts.first())->updateFilterGroup();static_cast<QQmlPartsModel *>(d->m_pendingParts.first())->updateFilterGroup();never executed: static_cast<QQmlPartsModel *>(d->m_pendingParts.first())->updateFilterGroup(); | 0 | ||||||||||||||||||||||||
| 249 | - | |||||||||||||||||||||||||
| 250 | QVector<Compositor::Insert> inserts; | - | ||||||||||||||||||||||||
| 251 | d->m_count = d->adaptorModelCount(); | - | ||||||||||||||||||||||||
| 252 | d->m_compositor.append( | - | ||||||||||||||||||||||||
| 253 | &d->m_adaptorModel, | - | ||||||||||||||||||||||||
| 254 | 0, | - | ||||||||||||||||||||||||
| 255 | d->m_count, | - | ||||||||||||||||||||||||
| 256 | defaultGroups | Compositor::AppendFlag | Compositor::PrependFlag, | - | ||||||||||||||||||||||||
| 257 | &inserts); | - | ||||||||||||||||||||||||
| 258 | d->itemsInserted(inserts); | - | ||||||||||||||||||||||||
| 259 | d->emitChanges(); | - | ||||||||||||||||||||||||
| 260 | d->requestMoreIfNecessary(); | - | ||||||||||||||||||||||||
| 261 | } executed 5622 times by 27 tests: end of blockExecuted by:
| 5622 | ||||||||||||||||||||||||
| 262 | QVariant QQmlDelegateModel::model() const | - | ||||||||||||||||||||||||
| 263 | { | - | ||||||||||||||||||||||||
| 264 | const QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 265 | return executed 8 times by 1 test: d->m_adaptorModel.model();return d->m_adaptorModel.model();Executed by:
executed 8 times by 1 test: return d->m_adaptorModel.model();Executed by:
| 8 | ||||||||||||||||||||||||
| 266 | } | - | ||||||||||||||||||||||||
| 267 | - | |||||||||||||||||||||||||
| 268 | void QQmlDelegateModel::setModel(const QVariant &model) | - | ||||||||||||||||||||||||
| 269 | { | - | ||||||||||||||||||||||||
| 270 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 271 | - | |||||||||||||||||||||||||
| 272 | if (d->m_complete
| 648-4316 | ||||||||||||||||||||||||
| 273 | _q_itemsRemoved(0, d->m_count); executed 648 times by 12 tests: _q_itemsRemoved(0, d->m_count);Executed by:
| 648 | ||||||||||||||||||||||||
| 274 | - | |||||||||||||||||||||||||
| 275 | d->m_adaptorModel.setModel(model, this, d->m_context->engine()); | - | ||||||||||||||||||||||||
| 276 | d->m_adaptorModel.replaceWatchedRoles(QList<QByteArray>(), d->m_watchedRoles); | - | ||||||||||||||||||||||||
| 277 | for (int i = 0; d->m_parts
| 136-4828 | ||||||||||||||||||||||||
| 278 | d->m_adaptorModel.replaceWatchedRoles( | - | ||||||||||||||||||||||||
| 279 | QList<QByteArray>(), d->m_parts->models.at(i)->watchedRoles()); | - | ||||||||||||||||||||||||
| 280 | } executed 146 times by 5 tests: end of blockExecuted by:
| 146 | ||||||||||||||||||||||||
| 281 | - | |||||||||||||||||||||||||
| 282 | if (d->m_complete
| 648-4316 | ||||||||||||||||||||||||
| 283 | _q_itemsInserted(0, d->adaptorModelCount()); | - | ||||||||||||||||||||||||
| 284 | d->requestMoreIfNecessary(); | - | ||||||||||||||||||||||||
| 285 | } executed 648 times by 12 tests: end of blockExecuted by:
| 648 | ||||||||||||||||||||||||
| 286 | } executed 4964 times by 25 tests: end of blockExecuted by:
| 4964 | ||||||||||||||||||||||||
| 287 | QQmlComponent *QQmlDelegateModel::delegate() const | - | ||||||||||||||||||||||||
| 288 | { | - | ||||||||||||||||||||||||
| 289 | const QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 290 | return executed 91304 times by 25 tests: d->m_delegate;return d->m_delegate;Executed by:
executed 91304 times by 25 tests: return d->m_delegate;Executed by:
| 91304 | ||||||||||||||||||||||||
| 291 | } | - | ||||||||||||||||||||||||
| 292 | - | |||||||||||||||||||||||||
| 293 | void QQmlDelegateModel::setDelegate(QQmlComponent *delegate) | - | ||||||||||||||||||||||||
| 294 | { | - | ||||||||||||||||||||||||
| 295 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 296 | if (d->m_transaction
| 0-5616 | ||||||||||||||||||||||||
| 297 | qmlWarning(this) << tr("The delegate of a DelegateModel cannot be changed within onUpdated."); | - | ||||||||||||||||||||||||
| 298 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 299 | } | - | ||||||||||||||||||||||||
| 300 | bool wasValid = d->m_delegate != nullptr; | - | ||||||||||||||||||||||||
| 301 | d->m_delegate.setObject(delegate, this); | - | ||||||||||||||||||||||||
| 302 | d->m_delegateValidated = false; | - | ||||||||||||||||||||||||
| 303 | if (wasValid
| 0-5598 | ||||||||||||||||||||||||
| 304 | for (int i = 1; i < d->m_groupCount
| 18-36 | ||||||||||||||||||||||||
| 305 | QQmlDelegateModelGroupPrivate::get(d->m_groups[i])->changeSet.remove( | - | ||||||||||||||||||||||||
| 306 | 0, d->m_compositor.count(Compositor::Group(i))); | - | ||||||||||||||||||||||||
| 307 | } executed 36 times by 5 tests: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||
| 308 | } executed 18 times by 5 tests: end of blockExecuted by:
| 18 | ||||||||||||||||||||||||
| 309 | if (d->m_complete
| 20-5596 | ||||||||||||||||||||||||
| 310 | for (int i = 1; i < d->m_groupCount
| 14-28 | ||||||||||||||||||||||||
| 311 | QQmlDelegateModelGroupPrivate::get(d->m_groups[i])->changeSet.insert( | - | ||||||||||||||||||||||||
| 312 | 0, d->m_compositor.count(Compositor::Group(i))); | - | ||||||||||||||||||||||||
| 313 | } executed 28 times by 4 tests: end of blockExecuted by:
| 28 | ||||||||||||||||||||||||
| 314 | } executed 14 times by 4 tests: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||
| 315 | d->emitChanges(); | - | ||||||||||||||||||||||||
| 316 | } executed 5616 times by 26 tests: end of blockExecuted by:
| 5616 | ||||||||||||||||||||||||
| 317 | QVariant QQmlDelegateModel::rootIndex() const | - | ||||||||||||||||||||||||
| 318 | { | - | ||||||||||||||||||||||||
| 319 | const QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 320 | return executed 22 times by 1 test: QVariant::fromValue(QModelIndex(d->m_adaptorModel.rootIndex));return QVariant::fromValue(QModelIndex(d->m_adaptorModel.rootIndex));Executed by:
executed 22 times by 1 test: return QVariant::fromValue(QModelIndex(d->m_adaptorModel.rootIndex));Executed by:
| 22 | ||||||||||||||||||||||||
| 321 | } | - | ||||||||||||||||||||||||
| 322 | - | |||||||||||||||||||||||||
| 323 | void QQmlDelegateModel::setRootIndex(const QVariant &root) | - | ||||||||||||||||||||||||
| 324 | { | - | ||||||||||||||||||||||||
| 325 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 326 | - | |||||||||||||||||||||||||
| 327 | QModelIndex modelIndex = qvariant_cast<QModelIndex>(root); | - | ||||||||||||||||||||||||
| 328 | const bool changed = d->m_adaptorModel.rootIndex != modelIndex; | - | ||||||||||||||||||||||||
| 329 | if (changed
| 2-24 | ||||||||||||||||||||||||
| 330 | const int oldCount = d->m_count; | - | ||||||||||||||||||||||||
| 331 | d->m_adaptorModel.rootIndex = modelIndex; | - | ||||||||||||||||||||||||
| 332 | if (!d->m_adaptorModel.isValid()
| 0-24 | ||||||||||||||||||||||||
| 333 | d->m_adaptorModel.setModel(d->m_adaptorModel.list.list(), this, d->m_context->engine()); executed 2 times by 1 test: d->m_adaptorModel.setModel(d->m_adaptorModel.list.list(), this, d->m_context->engine());Executed by:
| 2 | ||||||||||||||||||||||||
| 334 | if (d->m_adaptorModel.canFetchMore()
| 0-26 | ||||||||||||||||||||||||
| 335 | d->m_adaptorModel.fetchMore(); never executed: d->m_adaptorModel.fetchMore(); | 0 | ||||||||||||||||||||||||
| 336 | if (d->m_complete
| 0-26 | ||||||||||||||||||||||||
| 337 | const int newCount = d->adaptorModelCount(); | - | ||||||||||||||||||||||||
| 338 | if (oldCount
| 4-22 | ||||||||||||||||||||||||
| 339 | _q_itemsRemoved(0, oldCount); executed 22 times by 3 tests: _q_itemsRemoved(0, oldCount);Executed by:
| 22 | ||||||||||||||||||||||||
| 340 | if (newCount
| 6-20 | ||||||||||||||||||||||||
| 341 | _q_itemsInserted(0, newCount); executed 20 times by 3 tests: _q_itemsInserted(0, newCount);Executed by:
| 20 | ||||||||||||||||||||||||
| 342 | } executed 26 times by 3 tests: end of blockExecuted by:
| 26 | ||||||||||||||||||||||||
| 343 | if (changed
| 2-24 | ||||||||||||||||||||||||
| 344 | rootIndexChanged(); executed 24 times by 3 tests: rootIndexChanged();Executed by:
| 24 | ||||||||||||||||||||||||
| 345 | } executed 26 times by 3 tests: end of blockExecuted by:
| 26 | ||||||||||||||||||||||||
| 346 | } executed 28 times by 3 tests: end of blockExecuted by:
| 28 | ||||||||||||||||||||||||
| 347 | int QQmlDelegateModel::rows() const | - | ||||||||||||||||||||||||
| 348 | { | - | ||||||||||||||||||||||||
| 349 | const QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 350 | return executed 102 times by 1 test: d->m_adaptorModel.rowCount();return d->m_adaptorModel.rowCount();Executed by:
executed 102 times by 1 test: return d->m_adaptorModel.rowCount();Executed by:
| 102 | ||||||||||||||||||||||||
| 351 | } | - | ||||||||||||||||||||||||
| 352 | int QQmlDelegateModel::columns() const | - | ||||||||||||||||||||||||
| 353 | { | - | ||||||||||||||||||||||||
| 354 | const QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 355 | return executed 102 times by 1 test: d->m_adaptorModel.columnCount();return d->m_adaptorModel.columnCount();Executed by:
executed 102 times by 1 test: return d->m_adaptorModel.columnCount();Executed by:
| 102 | ||||||||||||||||||||||||
| 356 | } | - | ||||||||||||||||||||||||
| 357 | QVariant QQmlDelegateModel::modelIndex(int idx) const | - | ||||||||||||||||||||||||
| 358 | { | - | ||||||||||||||||||||||||
| 359 | const QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 360 | return executed 6 times by 2 tests: d->m_adaptorModel.modelIndex(idx);return d->m_adaptorModel.modelIndex(idx);Executed by:
executed 6 times by 2 tests: return d->m_adaptorModel.modelIndex(idx);Executed by:
| 6 | ||||||||||||||||||||||||
| 361 | } | - | ||||||||||||||||||||||||
| 362 | QVariant QQmlDelegateModel::parentModelIndex() const | - | ||||||||||||||||||||||||
| 363 | { | - | ||||||||||||||||||||||||
| 364 | const QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 365 | return executed 2 times by 1 test: d->m_adaptorModel.parentModelIndex();return d->m_adaptorModel.parentModelIndex();Executed by:
executed 2 times by 1 test: return d->m_adaptorModel.parentModelIndex();Executed by:
| 2 | ||||||||||||||||||||||||
| 366 | } | - | ||||||||||||||||||||||||
| 367 | - | |||||||||||||||||||||||||
| 368 | - | |||||||||||||||||||||||||
| 369 | - | |||||||||||||||||||||||||
| 370 | - | |||||||||||||||||||||||||
| 371 | - | |||||||||||||||||||||||||
| 372 | int QQmlDelegateModel::count() const | - | ||||||||||||||||||||||||
| 373 | { | - | ||||||||||||||||||||||||
| 374 | const QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 375 | if (!d->m_delegate
| 3754-457981 | ||||||||||||||||||||||||
| 376 | return executed 3754 times by 14 tests: 0;return 0;Executed by:
executed 3754 times by 14 tests: return 0;Executed by:
| 3754 | ||||||||||||||||||||||||
| 377 | return executed 457981 times by 25 tests: d->m_compositor.count(d->m_compositorGroup);return d->m_compositor.count(d->m_compositorGroup);Executed by:
executed 457981 times by 25 tests: return d->m_compositor.count(d->m_compositorGroup);Executed by:
| 457981 | ||||||||||||||||||||||||
| 378 | } | - | ||||||||||||||||||||||||
| 379 | - | |||||||||||||||||||||||||
| 380 | QQmlDelegateModel::ReleaseFlags QQmlDelegateModelPrivate::release(QObject *object) | - | ||||||||||||||||||||||||
| 381 | { | - | ||||||||||||||||||||||||
| 382 | if (!object
| 2-103163 | ||||||||||||||||||||||||
| 383 | return executed 2 times by 1 test: QQmlDelegateModel::ReleaseFlags(0);return QQmlDelegateModel::ReleaseFlags(0);Executed by:
executed 2 times by 1 test: return QQmlDelegateModel::ReleaseFlags(0);Executed by:
| 2 | ||||||||||||||||||||||||
| 384 | - | |||||||||||||||||||||||||
| 385 | QQmlDelegateModelItem *cacheItem = QQmlDelegateModelItem::dataForObject(object); | - | ||||||||||||||||||||||||
| 386 | if (!cacheItem
| 36665-66498 | ||||||||||||||||||||||||
| 387 | return executed 66498 times by 23 tests: QQmlDelegateModel::ReleaseFlags(0);return QQmlDelegateModel::ReleaseFlags(0);Executed by:
executed 66498 times by 23 tests: return QQmlDelegateModel::ReleaseFlags(0);Executed by:
| 66498 | ||||||||||||||||||||||||
| 388 | - | |||||||||||||||||||||||||
| 389 | if (!cacheItem->releaseObject()
| 14407-22258 | ||||||||||||||||||||||||
| 390 | return executed 14407 times by 19 tests: QQmlDelegateModel::Referenced;return QQmlDelegateModel::Referenced;Executed by:
executed 14407 times by 19 tests: return QQmlDelegateModel::Referenced;Executed by:
| 14407 | ||||||||||||||||||||||||
| 391 | - | |||||||||||||||||||||||||
| 392 | cacheItem->destroyObject(); | - | ||||||||||||||||||||||||
| 393 | emitDestroyingItem(object); | - | ||||||||||||||||||||||||
| 394 | if (cacheItem->incubationTask
| 0-22258 | ||||||||||||||||||||||||
| 395 | releaseIncubator(cacheItem->incubationTask); | - | ||||||||||||||||||||||||
| 396 | cacheItem->incubationTask = nullptr; | - | ||||||||||||||||||||||||
| 397 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 398 | cacheItem->Dispose(); | - | ||||||||||||||||||||||||
| 399 | return executed 22258 times by 12 tests: QQmlInstanceModel::Destroyed;return QQmlInstanceModel::Destroyed;Executed by:
executed 22258 times by 12 tests: return QQmlInstanceModel::Destroyed;Executed by:
| 22258 | ||||||||||||||||||||||||
| 400 | } | - | ||||||||||||||||||||||||
| 401 | - | |||||||||||||||||||||||||
| 402 | - | |||||||||||||||||||||||||
| 403 | - | |||||||||||||||||||||||||
| 404 | - | |||||||||||||||||||||||||
| 405 | - | |||||||||||||||||||||||||
| 406 | QQmlDelegateModel::ReleaseFlags QQmlDelegateModel::release(QObject *item) | - | ||||||||||||||||||||||||
| 407 | { | - | ||||||||||||||||||||||||
| 408 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 409 | QQmlInstanceModel::ReleaseFlags stat = d->release(item); | - | ||||||||||||||||||||||||
| 410 | return executed 99859 times by 24 tests: stat;return stat;Executed by:
executed 99859 times by 24 tests: return stat;Executed by:
| 99859 | ||||||||||||||||||||||||
| 411 | } | - | ||||||||||||||||||||||||
| 412 | - | |||||||||||||||||||||||||
| 413 | - | |||||||||||||||||||||||||
| 414 | void QQmlDelegateModel::cancel(int index) | - | ||||||||||||||||||||||||
| 415 | { | - | ||||||||||||||||||||||||
| 416 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 417 | if (!d->m_delegate
| 0-50 | ||||||||||||||||||||||||
| 418 | QMessageLogger(__FILE__, 610, __PRETTY_FUNCTION__).warning() << "DelegateModel::cancel: index out range" << index << d->m_compositor.count(d->m_compositorGroup); | - | ||||||||||||||||||||||||
| 419 | return; executed 50 times by 2 tests: return;Executed by:
| 50 | ||||||||||||||||||||||||
| 420 | } | - | ||||||||||||||||||||||||
| 421 | - | |||||||||||||||||||||||||
| 422 | Compositor::iterator it = d->m_compositor.find(d->m_compositorGroup, index); | - | ||||||||||||||||||||||||
| 423 | QQmlDelegateModelItem *cacheItem = it->inCache()
| 0-31 | ||||||||||||||||||||||||
| 424 | if (cacheItem
| 0-31 | ||||||||||||||||||||||||
| 425 | if (cacheItem->incubationTask
| 0-31 | ||||||||||||||||||||||||
| 426 | d->releaseIncubator(cacheItem->incubationTask); | - | ||||||||||||||||||||||||
| 427 | cacheItem->incubationTask = nullptr; | - | ||||||||||||||||||||||||
| 428 | - | |||||||||||||||||||||||||
| 429 | if (cacheItem->object
| 0-31 | ||||||||||||||||||||||||
| 430 | QObject *object = cacheItem->object; | - | ||||||||||||||||||||||||
| 431 | cacheItem->destroyObject(); | - | ||||||||||||||||||||||||
| 432 | if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(object)
| 0 | ||||||||||||||||||||||||
| 433 | d->emitDestroyingPackage(package); never executed: d->emitDestroyingPackage(package); | 0 | ||||||||||||||||||||||||
| 434 | else | - | ||||||||||||||||||||||||
| 435 | d->emitDestroyingItem(object); never executed: d->emitDestroyingItem(object); | 0 | ||||||||||||||||||||||||
| 436 | } | - | ||||||||||||||||||||||||
| 437 | - | |||||||||||||||||||||||||
| 438 | cacheItem->scriptRef -= 1; | - | ||||||||||||||||||||||||
| 439 | } executed 31 times by 3 tests: end of blockExecuted by:
| 31 | ||||||||||||||||||||||||
| 440 | if (!cacheItem->isReferenced()
| 0-31 | ||||||||||||||||||||||||
| 441 | d->m_compositor.clearFlags(Compositor::Cache, it.cacheIndex, 1, Compositor::CacheFlag); | - | ||||||||||||||||||||||||
| 442 | d->m_cache.removeAt(it.cacheIndex); | - | ||||||||||||||||||||||||
| 443 | delete cacheItem; | - | ||||||||||||||||||||||||
| 444 | ((d->m_cache.count() == d->m_compositor.count(Compositor::Cache)) ? static_cast<void>(0) : qt_assert("d->m_cache.count() == d->m_compositor.count(Compositor::Cache)", __FILE__, 636)); | - | ||||||||||||||||||||||||
| 445 | } executed 31 times by 3 tests: end of blockExecuted by:
| 31 | ||||||||||||||||||||||||
| 446 | } executed 31 times by 3 tests: end of blockExecuted by:
| 31 | ||||||||||||||||||||||||
| 447 | } executed 31 times by 3 tests: end of blockExecuted by:
| 31 | ||||||||||||||||||||||||
| 448 | - | |||||||||||||||||||||||||
| 449 | void QQmlDelegateModelPrivate::group_append( | - | ||||||||||||||||||||||||
| 450 | QQmlListProperty<QQmlDelegateModelGroup> *property, QQmlDelegateModelGroup *group) | - | ||||||||||||||||||||||||
| 451 | { | - | ||||||||||||||||||||||||
| 452 | QQmlDelegateModelPrivate *d = static_cast<QQmlDelegateModelPrivate *>(property->data); | - | ||||||||||||||||||||||||
| 453 | if (d->m_complete
| 0-1076 | ||||||||||||||||||||||||
| 454 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 455 | if (d->m_groupCount == Compositor::MaximumGroupCount
| 0-1076 | ||||||||||||||||||||||||
| 456 | qmlWarning(d->q_func()) << QQmlDelegateModel::tr("The maximum number of supported DelegateModelGroups is 8"); | - | ||||||||||||||||||||||||
| 457 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 458 | } | - | ||||||||||||||||||||||||
| 459 | d->m_groups[d->m_groupCount] = group; | - | ||||||||||||||||||||||||
| 460 | d->m_groupCount += 1; | - | ||||||||||||||||||||||||
| 461 | } executed 1076 times by 2 tests: end of blockExecuted by:
| 1076 | ||||||||||||||||||||||||
| 462 | - | |||||||||||||||||||||||||
| 463 | int QQmlDelegateModelPrivate::group_count( | - | ||||||||||||||||||||||||
| 464 | QQmlListProperty<QQmlDelegateModelGroup> *property) | - | ||||||||||||||||||||||||
| 465 | { | - | ||||||||||||||||||||||||
| 466 | QQmlDelegateModelPrivate *d = static_cast<QQmlDelegateModelPrivate *>(property->data); | - | ||||||||||||||||||||||||
| 467 | return executed 10 times by 1 test: d->m_groupCount - 1;return d->m_groupCount - 1;Executed by:
executed 10 times by 1 test: return d->m_groupCount - 1;Executed by:
| 10 | ||||||||||||||||||||||||
| 468 | } | - | ||||||||||||||||||||||||
| 469 | - | |||||||||||||||||||||||||
| 470 | QQmlDelegateModelGroup *QQmlDelegateModelPrivate::group_at( | - | ||||||||||||||||||||||||
| 471 | QQmlListProperty<QQmlDelegateModelGroup> *property, int index) | - | ||||||||||||||||||||||||
| 472 | { | - | ||||||||||||||||||||||||
| 473 | QQmlDelegateModelPrivate *d = static_cast<QQmlDelegateModelPrivate *>(property->data); | - | ||||||||||||||||||||||||
| 474 | return executed 8 times by 1 test: index >= 0 && index < d->m_groupCount - 1return index >= 0 && index < d->m_groupCount - 1 ? d->m_groups[index + 1] : nullptr;Executed by:
executed 8 times by 1 test: return index >= 0 && index < d->m_groupCount - 1 ? d->m_groups[index + 1] : nullptr;Executed by:
| 8 | ||||||||||||||||||||||||
| 475 | ? d->m_groups[index + 1] executed 8 times by 1 test: return index >= 0 && index < d->m_groupCount - 1 ? d->m_groups[index + 1] : nullptr;Executed by:
| 8 | ||||||||||||||||||||||||
| 476 | : nullptr; executed 8 times by 1 test: return index >= 0 && index < d->m_groupCount - 1 ? d->m_groups[index + 1] : nullptr;Executed by:
| 8 | ||||||||||||||||||||||||
| 477 | } | - | ||||||||||||||||||||||||
| 478 | QQmlListProperty<QQmlDelegateModelGroup> QQmlDelegateModel::groups() | - | ||||||||||||||||||||||||
| 479 | { | - | ||||||||||||||||||||||||
| 480 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 481 | return executed 548 times by 2 tests: QQmlListProperty<QQmlDelegateModelGroup>(return QQmlListProperty<QQmlDelegateModelGroup>( this, d, QQmlDelegateModelPrivate::group_append, QQmlDelegateModelPrivate::group_count, QQmlDelegateModelPrivate::group_at, nullptr);Executed by:
executed 548 times by 2 tests: return QQmlListProperty<QQmlDelegateModelGroup>( this, d, QQmlDelegateModelPrivate::group_append, QQmlDelegateModelPrivate::group_count, QQmlDelegateModelPrivate::group_at, nullptr);Executed by:
| 548 | ||||||||||||||||||||||||
| 482 | this, executed 548 times by 2 tests: return QQmlListProperty<QQmlDelegateModelGroup>( this, d, QQmlDelegateModelPrivate::group_append, QQmlDelegateModelPrivate::group_count, QQmlDelegateModelPrivate::group_at, nullptr);Executed by:
| 548 | ||||||||||||||||||||||||
| 483 | d, executed 548 times by 2 tests: return QQmlListProperty<QQmlDelegateModelGroup>( this, d, QQmlDelegateModelPrivate::group_append, QQmlDelegateModelPrivate::group_count, QQmlDelegateModelPrivate::group_at, nullptr);Executed by:
| 548 | ||||||||||||||||||||||||
| 484 | QQmlDelegateModelPrivate::group_append, executed 548 times by 2 tests: return QQmlListProperty<QQmlDelegateModelGroup>( this, d, QQmlDelegateModelPrivate::group_append, QQmlDelegateModelPrivate::group_count, QQmlDelegateModelPrivate::group_at, nullptr);Executed by:
| 548 | ||||||||||||||||||||||||
| 485 | QQmlDelegateModelPrivate::group_count, executed 548 times by 2 tests: return QQmlListProperty<QQmlDelegateModelGroup>( this, d, QQmlDelegateModelPrivate::group_append, QQmlDelegateModelPrivate::group_count, QQmlDelegateModelPrivate::group_at, nullptr);Executed by:
| 548 | ||||||||||||||||||||||||
| 486 | QQmlDelegateModelPrivate::group_at, executed 548 times by 2 tests: return QQmlListProperty<QQmlDelegateModelGroup>( this, d, QQmlDelegateModelPrivate::group_append, QQmlDelegateModelPrivate::group_count, QQmlDelegateModelPrivate::group_at, nullptr);Executed by:
| 548 | ||||||||||||||||||||||||
| 487 | nullptr); executed 548 times by 2 tests: return QQmlListProperty<QQmlDelegateModelGroup>( this, d, QQmlDelegateModelPrivate::group_append, QQmlDelegateModelPrivate::group_count, QQmlDelegateModelPrivate::group_at, nullptr);Executed by:
| 548 | ||||||||||||||||||||||||
| 488 | } | - | ||||||||||||||||||||||||
| 489 | - | |||||||||||||||||||||||||
| 490 | - | |||||||||||||||||||||||||
| 491 | - | |||||||||||||||||||||||||
| 492 | - | |||||||||||||||||||||||||
| 493 | - | |||||||||||||||||||||||||
| 494 | - | |||||||||||||||||||||||||
| 495 | - | |||||||||||||||||||||||||
| 496 | QQmlDelegateModelGroup *QQmlDelegateModel::items() | - | ||||||||||||||||||||||||
| 497 | { | - | ||||||||||||||||||||||||
| 498 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 499 | return executed 25934 times by 3 tests: d->m_items;return d->m_items;Executed by:
executed 25934 times by 3 tests: return d->m_items;Executed by:
| 25934 | ||||||||||||||||||||||||
| 500 | } | - | ||||||||||||||||||||||||
| 501 | QQmlDelegateModelGroup *QQmlDelegateModel::persistedItems() | - | ||||||||||||||||||||||||
| 502 | { | - | ||||||||||||||||||||||||
| 503 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 504 | return executed 536 times by 1 test: d->m_persistedItems;return d->m_persistedItems;Executed by:
executed 536 times by 1 test: return d->m_persistedItems;Executed by:
| 536 | ||||||||||||||||||||||||
| 505 | } | - | ||||||||||||||||||||||||
| 506 | QString QQmlDelegateModel::filterGroup() const | - | ||||||||||||||||||||||||
| 507 | { | - | ||||||||||||||||||||||||
| 508 | const QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 509 | return executed 8 times by 1 test: d->m_filterGroup;return d->m_filterGroup;Executed by:
executed 8 times by 1 test: return d->m_filterGroup;Executed by:
| 8 | ||||||||||||||||||||||||
| 510 | } | - | ||||||||||||||||||||||||
| 511 | - | |||||||||||||||||||||||||
| 512 | void QQmlDelegateModel::setFilterGroup(const QString &group) | - | ||||||||||||||||||||||||
| 513 | { | - | ||||||||||||||||||||||||
| 514 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 515 | - | |||||||||||||||||||||||||
| 516 | if (d->m_transaction
| 0-6 | ||||||||||||||||||||||||
| 517 | qmlWarning(this) << tr("The group of a DelegateModel cannot be changed within onChanged"); | - | ||||||||||||||||||||||||
| 518 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 519 | } | - | ||||||||||||||||||||||||
| 520 | - | |||||||||||||||||||||||||
| 521 | if (d->m_filterGroup != group
| 0-6 | ||||||||||||||||||||||||
| 522 | d->m_filterGroup = group; | - | ||||||||||||||||||||||||
| 523 | d->updateFilterGroup(); | - | ||||||||||||||||||||||||
| 524 | filterGroupChanged(); | - | ||||||||||||||||||||||||
| 525 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 526 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 527 | - | |||||||||||||||||||||||||
| 528 | void QQmlDelegateModel::resetFilterGroup() | - | ||||||||||||||||||||||||
| 529 | { | - | ||||||||||||||||||||||||
| 530 | setFilterGroup(([]() noexcept -> QString { enum { Size = sizeof(u"" "items")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "items" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 2 times by 1 test: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 2 times by 1 test: }()));return qstring_literal_temp;Executed by:
| 2 | ||||||||||||||||||||||||
| 531 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 532 | - | |||||||||||||||||||||||||
| 533 | void QQmlDelegateModelPrivate::updateFilterGroup() | - | ||||||||||||||||||||||||
| 534 | { | - | ||||||||||||||||||||||||
| 535 | QQmlDelegateModel * const q = q_func(); | - | ||||||||||||||||||||||||
| 536 | if (!m_cacheMetaType
| 0-5628 | ||||||||||||||||||||||||
| 537 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 538 | - | |||||||||||||||||||||||||
| 539 | QQmlListCompositor::Group previousGroup = m_compositorGroup; | - | ||||||||||||||||||||||||
| 540 | m_compositorGroup = Compositor::Default; | - | ||||||||||||||||||||||||
| 541 | for (int i = 1; i < m_groupCount
| 0-5638 | ||||||||||||||||||||||||
| 542 | if (m_filterGroup == m_cacheMetaType->groupNames.at(i - 1)
| 10-5628 | ||||||||||||||||||||||||
| 543 | m_compositorGroup = Compositor::Group(i); | - | ||||||||||||||||||||||||
| 544 | break; executed 5628 times by 27 tests: break;Executed by:
| 5628 | ||||||||||||||||||||||||
| 545 | } | - | ||||||||||||||||||||||||
| 546 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 547 | - | |||||||||||||||||||||||||
| 548 | QQmlDelegateModelGroupPrivate::get(m_groups[m_compositorGroup])->emitters.insert(this); | - | ||||||||||||||||||||||||
| 549 | if (m_compositorGroup != previousGroup
| 0-5628 | ||||||||||||||||||||||||
| 550 | QVector<QQmlChangeSet::Change> removes; | - | ||||||||||||||||||||||||
| 551 | QVector<QQmlChangeSet::Change> inserts; | - | ||||||||||||||||||||||||
| 552 | m_compositor.transition(previousGroup, m_compositorGroup, &removes, &inserts); | - | ||||||||||||||||||||||||
| 553 | - | |||||||||||||||||||||||||
| 554 | QQmlChangeSet changeSet; | - | ||||||||||||||||||||||||
| 555 | changeSet.move(removes, inserts); | - | ||||||||||||||||||||||||
| 556 | q->modelUpdated(changeSet, false); | - | ||||||||||||||||||||||||
| 557 | - | |||||||||||||||||||||||||
| 558 | if (changeSet.difference() != 0
| 6-5622 | ||||||||||||||||||||||||
| 559 | q->countChanged(); executed 6 times by 1 test: q->countChanged();Executed by:
| 6 | ||||||||||||||||||||||||
| 560 | - | |||||||||||||||||||||||||
| 561 | if (m_parts
| 352-5276 | ||||||||||||||||||||||||
| 562 | auto partsCopy = m_parts->models; | - | ||||||||||||||||||||||||
| 563 | for (QQmlPartsModel *model : qAsConst(partsCopy)) | - | ||||||||||||||||||||||||
| 564 | model->updateFilterGroup(m_compositorGroup, changeSet); executed 368 times by 6 tests: model->updateFilterGroup(m_compositorGroup, changeSet);Executed by:
| 368 | ||||||||||||||||||||||||
| 565 | } executed 352 times by 6 tests: end of blockExecuted by:
| 352 | ||||||||||||||||||||||||
| 566 | } executed 5628 times by 27 tests: end of blockExecuted by:
| 5628 | ||||||||||||||||||||||||
| 567 | } executed 5628 times by 27 tests: end of blockExecuted by:
| 5628 | ||||||||||||||||||||||||
| 568 | QObject *QQmlDelegateModel::parts() | - | ||||||||||||||||||||||||
| 569 | { | - | ||||||||||||||||||||||||
| 570 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 571 | if (!d->m_parts
| 30-352 | ||||||||||||||||||||||||
| 572 | d->m_parts = new QQmlDelegateModelParts(this); executed 352 times by 6 tests: d->m_parts = new QQmlDelegateModelParts(this);Executed by:
| 352 | ||||||||||||||||||||||||
| 573 | return executed 382 times by 6 tests: d->m_parts;return d->m_parts;Executed by:
executed 382 times by 6 tests: return d->m_parts;Executed by:
| 382 | ||||||||||||||||||||||||
| 574 | } | - | ||||||||||||||||||||||||
| 575 | - | |||||||||||||||||||||||||
| 576 | const QAbstractItemModel *QQmlDelegateModel::abstractItemModel() const | - | ||||||||||||||||||||||||
| 577 | { | - | ||||||||||||||||||||||||
| 578 | return never executed: d_func()->m_adaptorModel.aim();return d_func()->m_adaptorModel.aim();never executed: return d_func()->m_adaptorModel.aim(); | 0 | ||||||||||||||||||||||||
| 579 | } | - | ||||||||||||||||||||||||
| 580 | - | |||||||||||||||||||||||||
| 581 | void QQmlDelegateModelPrivate::emitCreatedPackage(QQDMIncubationTask *incubationTask, QQuickPackage *package) | - | ||||||||||||||||||||||||
| 582 | { | - | ||||||||||||||||||||||||
| 583 | for (int i = 1; i < m_groupCount
| 4962-12098 | ||||||||||||||||||||||||
| 584 | QQmlDelegateModelGroupPrivate::get(m_groups[i])->createdPackage(incubationTask->index[i], package); executed 12098 times by 6 tests: QQmlDelegateModelGroupPrivate::get(m_groups[i])->createdPackage(incubationTask->index[i], package);Executed by:
| 12098 | ||||||||||||||||||||||||
| 585 | } executed 4962 times by 6 tests: end of blockExecuted by:
| 4962 | ||||||||||||||||||||||||
| 586 | - | |||||||||||||||||||||||||
| 587 | void QQmlDelegateModelPrivate::emitInitPackage(QQDMIncubationTask *incubationTask, QQuickPackage *package) | - | ||||||||||||||||||||||||
| 588 | { | - | ||||||||||||||||||||||||
| 589 | for (int i = 1; i < m_groupCount
| 4962-12098 | ||||||||||||||||||||||||
| 590 | QQmlDelegateModelGroupPrivate::get(m_groups[i])->initPackage(incubationTask->index[i], package); executed 12098 times by 6 tests: QQmlDelegateModelGroupPrivate::get(m_groups[i])->initPackage(incubationTask->index[i], package);Executed by:
| 12098 | ||||||||||||||||||||||||
| 591 | } executed 4962 times by 6 tests: end of blockExecuted by:
| 4962 | ||||||||||||||||||||||||
| 592 | - | |||||||||||||||||||||||||
| 593 | void QQmlDelegateModelPrivate::emitDestroyingPackage(QQuickPackage *package) | - | ||||||||||||||||||||||||
| 594 | { | - | ||||||||||||||||||||||||
| 595 | for (int i = 1; i < m_groupCount
| 1658-3324 | ||||||||||||||||||||||||
| 596 | QQmlDelegateModelGroupPrivate::get(m_groups[i])->destroyingPackage(package); executed 3324 times by 3 tests: QQmlDelegateModelGroupPrivate::get(m_groups[i])->destroyingPackage(package);Executed by:
| 3324 | ||||||||||||||||||||||||
| 597 | } executed 1658 times by 3 tests: end of blockExecuted by:
| 1658 | ||||||||||||||||||||||||
| 598 | - | |||||||||||||||||||||||||
| 599 | static bool isDoneIncubating(QQmlIncubator::Status status) | - | ||||||||||||||||||||||||
| 600 | { | - | ||||||||||||||||||||||||
| 601 | return executed 265128 times by 25 tests: status == QQmlIncubator::Ready || status == QQmlIncubator::Error;return status == QQmlIncubator::Ready || status == QQmlIncubator::Error;Executed by:
executed 265128 times by 25 tests: return status == QQmlIncubator::Ready || status == QQmlIncubator::Error;Executed by:
| 265128 | ||||||||||||||||||||||||
| 602 | } | - | ||||||||||||||||||||||||
| 603 | - | |||||||||||||||||||||||||
| 604 | void QQDMIncubationTask::statusChanged(Status status) | - | ||||||||||||||||||||||||
| 605 | { | - | ||||||||||||||||||||||||
| 606 | if (vdm
| 29-265099 | ||||||||||||||||||||||||
| 607 | vdm->incubatorStatusChanged(this, status); | - | ||||||||||||||||||||||||
| 608 | } executed 265099 times by 25 tests: else if (isDoneIncubating(status)end of blockExecuted by:
| 0-265099 | ||||||||||||||||||||||||
| 609 | ((incubating) ? static_cast<void>(0) : qt_assert("incubating", __FILE__, 878)); | - | ||||||||||||||||||||||||
| 610 | - | |||||||||||||||||||||||||
| 611 | delete incubating->object; | - | ||||||||||||||||||||||||
| 612 | incubating->object = nullptr; | - | ||||||||||||||||||||||||
| 613 | if (incubating->contextData
| 0-29 | ||||||||||||||||||||||||
| 614 | incubating->contextData->invalidate(); | - | ||||||||||||||||||||||||
| 615 | ((incubating->contextData->refCount == 1) ? static_cast<void>(0) : qt_assert("incubating->contextData->refCount == 1", __FILE__, 884)); | - | ||||||||||||||||||||||||
| 616 | incubating->contextData = nullptr; | - | ||||||||||||||||||||||||
| 617 | } executed 29 times by 2 tests: end of blockExecuted by:
| 29 | ||||||||||||||||||||||||
| 618 | incubating->scriptRef = 0; | - | ||||||||||||||||||||||||
| 619 | incubating->deleteLater(); | - | ||||||||||||||||||||||||
| 620 | } executed 29 times by 2 tests: end of blockExecuted by:
| 29 | ||||||||||||||||||||||||
| 621 | } executed 265128 times by 25 tests: end of blockExecuted by:
| 265128 | ||||||||||||||||||||||||
| 622 | - | |||||||||||||||||||||||||
| 623 | void QQmlDelegateModelPrivate::releaseIncubator(QQDMIncubationTask *incubationTask) | - | ||||||||||||||||||||||||
| 624 | { | - | ||||||||||||||||||||||||
| 625 | QQmlDelegateModel * const q = q_func(); | - | ||||||||||||||||||||||||
| 626 | if (!incubationTask->isError()
| 0-88371 | ||||||||||||||||||||||||
| 627 | incubationTask->clear(); executed 88371 times by 25 tests: incubationTask->clear();Executed by:
| 88371 | ||||||||||||||||||||||||
| 628 | m_finishedIncubating.append(incubationTask); | - | ||||||||||||||||||||||||
| 629 | if (!m_incubatorCleanupScheduled
| 9109-79262 | ||||||||||||||||||||||||
| 630 | m_incubatorCleanupScheduled = true; | - | ||||||||||||||||||||||||
| 631 | QCoreApplication::postEvent(q, new QEvent(QEvent::User)); | - | ||||||||||||||||||||||||
| 632 | } executed 9109 times by 25 tests: end of blockExecuted by:
| 9109 | ||||||||||||||||||||||||
| 633 | } executed 88371 times by 25 tests: end of blockExecuted by:
| 88371 | ||||||||||||||||||||||||
| 634 | - | |||||||||||||||||||||||||
| 635 | void QQmlDelegateModelPrivate::addCacheItem(QQmlDelegateModelItem *item, Compositor::iterator it) | - | ||||||||||||||||||||||||
| 636 | { | - | ||||||||||||||||||||||||
| 637 | m_cache.insert(it.cacheIndex, item); | - | ||||||||||||||||||||||||
| 638 | m_compositor.setFlags(it, 1, Compositor::CacheFlag); | - | ||||||||||||||||||||||||
| 639 | ((m_cache.count() == m_compositor.count(Compositor::Cache)) ? static_cast<void>(0) : qt_assert("m_cache.count() == m_compositor.count(Compositor::Cache)", __FILE__, 908)); | - | ||||||||||||||||||||||||
| 640 | } executed 87987 times by 25 tests: end of blockExecuted by:
| 87987 | ||||||||||||||||||||||||
| 641 | - | |||||||||||||||||||||||||
| 642 | void QQmlDelegateModelPrivate::removeCacheItem(QQmlDelegateModelItem *cacheItem) | - | ||||||||||||||||||||||||
| 643 | { | - | ||||||||||||||||||||||||
| 644 | int cidx = m_cache.lastIndexOf(cacheItem); | - | ||||||||||||||||||||||||
| 645 | if (cidx >= 0
| 0-22297 | ||||||||||||||||||||||||
| 646 | m_compositor.clearFlags(Compositor::Cache, cidx, 1, Compositor::CacheFlag); | - | ||||||||||||||||||||||||
| 647 | m_cache.removeAt(cidx); | - | ||||||||||||||||||||||||
| 648 | } executed 22297 times by 12 tests: end of blockExecuted by:
| 22297 | ||||||||||||||||||||||||
| 649 | ((m_cache.count() == m_compositor.count(Compositor::Cache)) ? static_cast<void>(0) : qt_assert("m_cache.count() == m_compositor.count(Compositor::Cache)", __FILE__, 918)); | - | ||||||||||||||||||||||||
| 650 | } executed 22297 times by 12 tests: end of blockExecuted by:
| 22297 | ||||||||||||||||||||||||
| 651 | - | |||||||||||||||||||||||||
| 652 | void QQmlDelegateModelPrivate::incubatorStatusChanged(QQDMIncubationTask *incubationTask, QQmlIncubator::Status status) | - | ||||||||||||||||||||||||
| 653 | { | - | ||||||||||||||||||||||||
| 654 | if (!isDoneIncubating(status)
| 88321-176778 | ||||||||||||||||||||||||
| 655 | return; executed 176778 times by 25 tests: return;Executed by:
| 176778 | ||||||||||||||||||||||||
| 656 | - | |||||||||||||||||||||||||
| 657 | const QList<QQmlError> incubationTaskErrors = incubationTask->errors(); | - | ||||||||||||||||||||||||
| 658 | - | |||||||||||||||||||||||||
| 659 | QQmlDelegateModelItem *cacheItem = incubationTask->incubating; | - | ||||||||||||||||||||||||
| 660 | cacheItem->incubationTask = nullptr; | - | ||||||||||||||||||||||||
| 661 | incubationTask->incubating = nullptr; | - | ||||||||||||||||||||||||
| 662 | releaseIncubator(incubationTask); | - | ||||||||||||||||||||||||
| 663 | - | |||||||||||||||||||||||||
| 664 | if (status == QQmlIncubator::Ready
| 0-88321 | ||||||||||||||||||||||||
| 665 | cacheItem->referenceObject(); | - | ||||||||||||||||||||||||
| 666 | if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(cacheItem->object)
| 4962-83359 | ||||||||||||||||||||||||
| 667 | emitCreatedPackage(incubationTask, package); executed 4962 times by 6 tests: emitCreatedPackage(incubationTask, package);Executed by:
| 4962 | ||||||||||||||||||||||||
| 668 | else | - | ||||||||||||||||||||||||
| 669 | emitCreatedItem(incubationTask, cacheItem->object); executed 83359 times by 25 tests: emitCreatedItem(incubationTask, cacheItem->object);Executed by:
| 83359 | ||||||||||||||||||||||||
| 670 | cacheItem->releaseObject(); | - | ||||||||||||||||||||||||
| 671 | } executed 88321 times by 25 tests: else if (status == QQmlIncubator::Errorend of blockExecuted by:
| 0-88321 | ||||||||||||||||||||||||
| 672 | qmlWarning(m_delegate, incubationTaskErrors + m_delegate->errors()) << "Error creating delegate"; | - | ||||||||||||||||||||||||
| 673 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 674 | - | |||||||||||||||||||||||||
| 675 | if (!cacheItem->isObjectReferenced()
| 33-88288 | ||||||||||||||||||||||||
| 676 | if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(cacheItem->object)
| 0-33 | ||||||||||||||||||||||||
| 677 | emitDestroyingPackage(package); never executed: emitDestroyingPackage(package); | 0 | ||||||||||||||||||||||||
| 678 | else | - | ||||||||||||||||||||||||
| 679 | emitDestroyingItem(cacheItem->object); executed 33 times by 3 tests: emitDestroyingItem(cacheItem->object);Executed by:
| 33 | ||||||||||||||||||||||||
| 680 | delete cacheItem->object; | - | ||||||||||||||||||||||||
| 681 | cacheItem->object = nullptr; | - | ||||||||||||||||||||||||
| 682 | cacheItem->scriptRef -= 1; | - | ||||||||||||||||||||||||
| 683 | if (cacheItem->contextData
| 0-33 | ||||||||||||||||||||||||
| 684 | cacheItem->contextData->invalidate(); | - | ||||||||||||||||||||||||
| 685 | ((cacheItem->contextData->refCount == 1) ? static_cast<void>(0) : qt_assert("cacheItem->contextData->refCount == 1", __FILE__, 954)); | - | ||||||||||||||||||||||||
| 686 | } executed 33 times by 3 tests: end of blockExecuted by:
| 33 | ||||||||||||||||||||||||
| 687 | cacheItem->contextData = nullptr; | - | ||||||||||||||||||||||||
| 688 | - | |||||||||||||||||||||||||
| 689 | if (!cacheItem->isReferenced()
| 0-33 | ||||||||||||||||||||||||
| 690 | removeCacheItem(cacheItem); | - | ||||||||||||||||||||||||
| 691 | delete cacheItem; | - | ||||||||||||||||||||||||
| 692 | } executed 33 times by 3 tests: end of blockExecuted by:
| 33 | ||||||||||||||||||||||||
| 693 | } executed 33 times by 3 tests: end of blockExecuted by:
| 33 | ||||||||||||||||||||||||
| 694 | } executed 88321 times by 25 tests: end of blockExecuted by:
| 88321 | ||||||||||||||||||||||||
| 695 | - | |||||||||||||||||||||||||
| 696 | void QQDMIncubationTask::setInitialState(QObject *o) | - | ||||||||||||||||||||||||
| 697 | { | - | ||||||||||||||||||||||||
| 698 | vdm->setInitialState(this, o); | - | ||||||||||||||||||||||||
| 699 | } executed 88321 times by 25 tests: end of blockExecuted by:
| 88321 | ||||||||||||||||||||||||
| 700 | - | |||||||||||||||||||||||||
| 701 | void QQmlDelegateModelPrivate::setInitialState(QQDMIncubationTask *incubationTask, QObject *o) | - | ||||||||||||||||||||||||
| 702 | { | - | ||||||||||||||||||||||||
| 703 | QQmlDelegateModelItem *cacheItem = incubationTask->incubating; | - | ||||||||||||||||||||||||
| 704 | cacheItem->object = o; | - | ||||||||||||||||||||||||
| 705 | - | |||||||||||||||||||||||||
| 706 | if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(cacheItem->object)
| 4962-83359 | ||||||||||||||||||||||||
| 707 | emitInitPackage(incubationTask, package); executed 4962 times by 6 tests: emitInitPackage(incubationTask, package);Executed by:
| 4962 | ||||||||||||||||||||||||
| 708 | else | - | ||||||||||||||||||||||||
| 709 | emitInitItem(incubationTask, cacheItem->object); executed 83359 times by 25 tests: emitInitItem(incubationTask, cacheItem->object);Executed by:
| 83359 | ||||||||||||||||||||||||
| 710 | } | - | ||||||||||||||||||||||||
| 711 | - | |||||||||||||||||||||||||
| 712 | QObject *QQmlDelegateModelPrivate::object(Compositor::Group group, int index, QQmlIncubator::IncubationMode incubationMode) | - | ||||||||||||||||||||||||
| 713 | { | - | ||||||||||||||||||||||||
| 714 | if (!m_delegate
| 0-109307 | ||||||||||||||||||||||||
| 715 | QMessageLogger(__FILE__, 984, __PRETTY_FUNCTION__).warning() << "DelegateModel::item: index out range" << index << m_compositor.count(group); | - | ||||||||||||||||||||||||
| 716 | return never executed: nullptr;return nullptr;never executed: return nullptr; | 0 | ||||||||||||||||||||||||
| 717 | } else if (!m_context
| 0-109307 | ||||||||||||||||||||||||
| 718 | return executed 2 times by 1 test: nullptr;return nullptr;Executed by:
executed 2 times by 1 test: return nullptr;Executed by:
| 2 | ||||||||||||||||||||||||
| 719 | } | - | ||||||||||||||||||||||||
| 720 | - | |||||||||||||||||||||||||
| 721 | Compositor::iterator it = m_compositor.find(group, index); | - | ||||||||||||||||||||||||
| 722 | - | |||||||||||||||||||||||||
| 723 | QQmlDelegateModelItem *cacheItem = it->inCache()
| 21318-87987 | ||||||||||||||||||||||||
| 724 | - | |||||||||||||||||||||||||
| 725 | if (!cacheItem
| 21318-87987 | ||||||||||||||||||||||||
| 726 | cacheItem = m_adaptorModel.createItem(m_cacheMetaType, it.modelIndex()); | - | ||||||||||||||||||||||||
| 727 | if (!cacheItem
| 0-87987 | ||||||||||||||||||||||||
| 728 | return never executed: nullptr;return nullptr;never executed: return nullptr; | 0 | ||||||||||||||||||||||||
| 729 | - | |||||||||||||||||||||||||
| 730 | cacheItem->groups = it->flags; | - | ||||||||||||||||||||||||
| 731 | addCacheItem(cacheItem, it); | - | ||||||||||||||||||||||||
| 732 | } executed 87987 times by 25 tests: end of blockExecuted by:
| 87987 | ||||||||||||||||||||||||
| 733 | - | |||||||||||||||||||||||||
| 734 | - | |||||||||||||||||||||||||
| 735 | - | |||||||||||||||||||||||||
| 736 | cacheItem->scriptRef += 1; | - | ||||||||||||||||||||||||
| 737 | cacheItem->referenceObject(); | - | ||||||||||||||||||||||||
| 738 | - | |||||||||||||||||||||||||
| 739 | if (cacheItem->incubationTask
| 170-109135 | ||||||||||||||||||||||||
| 740 | bool sync = (incubationMode == QQmlIncubator::Synchronous
| 0-170 | ||||||||||||||||||||||||
| 741 | if (sync
| 2-168 | ||||||||||||||||||||||||
| 742 | - | |||||||||||||||||||||||||
| 743 | cacheItem->incubationTask->forceCompletion(); | - | ||||||||||||||||||||||||
| 744 | } executed 162 times by 3 tests: end of blockExecuted by:
| 162 | ||||||||||||||||||||||||
| 745 | } executed 170 times by 3 tests: else if (!cacheItem->objectend of blockExecuted by:
| 170-88407 | ||||||||||||||||||||||||
| 746 | QQmlContext *creationContext = m_delegate->creationContext(); | - | ||||||||||||||||||||||||
| 747 | - | |||||||||||||||||||||||||
| 748 | cacheItem->scriptRef += 1; | - | ||||||||||||||||||||||||
| 749 | - | |||||||||||||||||||||||||
| 750 | cacheItem->incubationTask = new QQDMIncubationTask(this, incubationMode); | - | ||||||||||||||||||||||||
| 751 | cacheItem->incubationTask->incubating = cacheItem; | - | ||||||||||||||||||||||||
| 752 | cacheItem->incubationTask->clear(); | - | ||||||||||||||||||||||||
| 753 | - | |||||||||||||||||||||||||
| 754 | for (int i = 1; i < m_groupCount
| 88407-182034 | ||||||||||||||||||||||||
| 755 | cacheItem->incubationTask->index[i] = it.index[i]; executed 182034 times by 25 tests: cacheItem->incubationTask->index[i] = it.index[i];Executed by:
| 182034 | ||||||||||||||||||||||||
| 756 | - | |||||||||||||||||||||||||
| 757 | QQmlContextData *ctxt = new QQmlContextData; | - | ||||||||||||||||||||||||
| 758 | ctxt->setParent(QQmlContextData::get(creationContext ? creationContext : m_context.data())); | - | ||||||||||||||||||||||||
| 759 | ctxt->contextObject = cacheItem; | - | ||||||||||||||||||||||||
| 760 | cacheItem->contextData = ctxt; | - | ||||||||||||||||||||||||
| 761 | - | |||||||||||||||||||||||||
| 762 | if (m_adaptorModel.hasProxyObject()
| 9985-78422 | ||||||||||||||||||||||||
| 763 | if (QQmlAdaptorModelProxyInterface *proxy
| 472-77950 | ||||||||||||||||||||||||
| 764 | = qobject_cast<QQmlAdaptorModelProxyInterface *>(cacheItem)
| 472-77950 | ||||||||||||||||||||||||
| 765 | ctxt = new QQmlContextData; | - | ||||||||||||||||||||||||
| 766 | ctxt->setParent(cacheItem->contextData, true); | - | ||||||||||||||||||||||||
| 767 | ctxt->contextObject = proxy->proxiedObject(); | - | ||||||||||||||||||||||||
| 768 | } executed 472 times by 3 tests: end of blockExecuted by:
| 472 | ||||||||||||||||||||||||
| 769 | } executed 78422 times by 12 tests: end of blockExecuted by:
| 78422 | ||||||||||||||||||||||||
| 770 | - | |||||||||||||||||||||||||
| 771 | QQmlComponentPrivate *cp = QQmlComponentPrivate::get(m_delegate); | - | ||||||||||||||||||||||||
| 772 | cp->incubateObject( | - | ||||||||||||||||||||||||
| 773 | cacheItem->incubationTask, | - | ||||||||||||||||||||||||
| 774 | m_delegate, | - | ||||||||||||||||||||||||
| 775 | m_context->engine(), | - | ||||||||||||||||||||||||
| 776 | ctxt, | - | ||||||||||||||||||||||||
| 777 | QQmlContextData::get(m_context)); | - | ||||||||||||||||||||||||
| 778 | } executed 88407 times by 25 tests: end of blockExecuted by:
| 88407 | ||||||||||||||||||||||||
| 779 | - | |||||||||||||||||||||||||
| 780 | if (index == m_compositor.count(group) - 1
| 8613-100692 | ||||||||||||||||||||||||
| 781 | requestMoreIfNecessary(); executed 8613 times by 24 tests: requestMoreIfNecessary();Executed by:
| 8613 | ||||||||||||||||||||||||
| 782 | - | |||||||||||||||||||||||||
| 783 | - | |||||||||||||||||||||||||
| 784 | cacheItem->scriptRef -= 1; | - | ||||||||||||||||||||||||
| 785 | if (cacheItem->object && (!cacheItem->incubationTask
| 0-106373 | ||||||||||||||||||||||||
| 786 | return executed 106373 times by 25 tests: cacheItem->object;return cacheItem->object;Executed by:
executed 106373 times by 25 tests: return cacheItem->object;Executed by:
| 106373 | ||||||||||||||||||||||||
| 787 | - | |||||||||||||||||||||||||
| 788 | cacheItem->releaseObject(); | - | ||||||||||||||||||||||||
| 789 | if (!cacheItem->isReferenced()
| 0-2932 | ||||||||||||||||||||||||
| 790 | removeCacheItem(cacheItem); | - | ||||||||||||||||||||||||
| 791 | delete cacheItem; | - | ||||||||||||||||||||||||
| 792 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 793 | - | |||||||||||||||||||||||||
| 794 | return executed 2932 times by 7 tests: nullptr;return nullptr;Executed by:
executed 2932 times by 7 tests: return nullptr;Executed by:
| 2932 | ||||||||||||||||||||||||
| 795 | } | - | ||||||||||||||||||||||||
| 796 | QObject *QQmlDelegateModel::object(int index, QQmlIncubator::IncubationMode incubationMode) | - | ||||||||||||||||||||||||
| 797 | { | - | ||||||||||||||||||||||||
| 798 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 799 | if (!d->m_delegate
| 0-103029 | ||||||||||||||||||||||||
| 800 | QMessageLogger(__FILE__, 1078, __PRETTY_FUNCTION__).warning() << "DelegateModel::item: index out range" << index << d->m_compositor.count(d->m_compositorGroup); | - | ||||||||||||||||||||||||
| 801 | return never executed: nullptr;return nullptr;never executed: return nullptr; | 0 | ||||||||||||||||||||||||
| 802 | } | - | ||||||||||||||||||||||||
| 803 | - | |||||||||||||||||||||||||
| 804 | return executed 103029 times by 25 tests: d->object(d->m_compositorGroup, index, incubationMode);return d->object(d->m_compositorGroup, index, incubationMode);Executed by:
executed 103029 times by 25 tests: return d->object(d->m_compositorGroup, index, incubationMode);Executed by:
| 103029 | ||||||||||||||||||||||||
| 805 | } | - | ||||||||||||||||||||||||
| 806 | - | |||||||||||||||||||||||||
| 807 | QQmlIncubator::Status QQmlDelegateModel::incubationStatus(int index) | - | ||||||||||||||||||||||||
| 808 | { | - | ||||||||||||||||||||||||
| 809 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 810 | Compositor::iterator it = d->m_compositor.find(d->m_compositorGroup, index); | - | ||||||||||||||||||||||||
| 811 | if (!it->inCache()
| 0-2770 | ||||||||||||||||||||||||
| 812 | return never executed: QQmlIncubator::Null;return QQmlIncubator::Null;never executed: return QQmlIncubator::Null; | 0 | ||||||||||||||||||||||||
| 813 | - | |||||||||||||||||||||||||
| 814 | if (auto incubationTask = d->m_cache.at(it.cacheIndex)->incubationTask
| 0-2770 | ||||||||||||||||||||||||
| 815 | return executed 2770 times by 4 tests: incubationTask->status();return incubationTask->status();Executed by:
executed 2770 times by 4 tests: return incubationTask->status();Executed by:
| 2770 | ||||||||||||||||||||||||
| 816 | - | |||||||||||||||||||||||||
| 817 | return never executed: QQmlIncubator::Ready;return QQmlIncubator::Ready;never executed: return QQmlIncubator::Ready; | 0 | ||||||||||||||||||||||||
| 818 | } | - | ||||||||||||||||||||||||
| 819 | - | |||||||||||||||||||||||||
| 820 | QString QQmlDelegateModelPrivate::stringValue(Compositor::Group group, int index, const QString &name) | - | ||||||||||||||||||||||||
| 821 | { | - | ||||||||||||||||||||||||
| 822 | Compositor::iterator it = m_compositor.find(group, index); | - | ||||||||||||||||||||||||
| 823 | if (QQmlAdaptorModel *model = it.list<QQmlAdaptorModel>()
| 0-7412 | ||||||||||||||||||||||||
| 824 | QString role = name; | - | ||||||||||||||||||||||||
| 825 | int dot = name.indexOf(QLatin1Char('.')); | - | ||||||||||||||||||||||||
| 826 | if (dot > 0
| 8-7404 | ||||||||||||||||||||||||
| 827 | role = name.left(dot); executed 8 times by 1 test: role = name.left(dot);Executed by:
| 8 | ||||||||||||||||||||||||
| 828 | QVariant value = model->value(it.modelIndex(), role); | - | ||||||||||||||||||||||||
| 829 | while (dot > 0
| 8-7412 | ||||||||||||||||||||||||
| 830 | QObject *obj = qvariant_cast<QObject*>(value); | - | ||||||||||||||||||||||||
| 831 | if (!obj
| 0-8 | ||||||||||||||||||||||||
| 832 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||
| 833 | int from = dot+1; | - | ||||||||||||||||||||||||
| 834 | dot = name.indexOf(QLatin1Char('.'), from); | - | ||||||||||||||||||||||||
| 835 | value = obj->property(name.midRef(from, dot - from).toUtf8()); | - | ||||||||||||||||||||||||
| 836 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 837 | return executed 7412 times by 4 tests: value.toString();return value.toString();Executed by:
executed 7412 times by 4 tests: return value.toString();Executed by:
| 7412 | ||||||||||||||||||||||||
| 838 | } | - | ||||||||||||||||||||||||
| 839 | return never executed: QString();return QString();never executed: return QString(); | 0 | ||||||||||||||||||||||||
| 840 | } | - | ||||||||||||||||||||||||
| 841 | - | |||||||||||||||||||||||||
| 842 | QString QQmlDelegateModel::stringValue(int index, const QString &name) | - | ||||||||||||||||||||||||
| 843 | { | - | ||||||||||||||||||||||||
| 844 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 845 | return executed 7008 times by 4 tests: d->stringValue(d->m_compositorGroup, index, name);return d->stringValue(d->m_compositorGroup, index, name);Executed by:
executed 7008 times by 4 tests: return d->stringValue(d->m_compositorGroup, index, name);Executed by:
| 7008 | ||||||||||||||||||||||||
| 846 | } | - | ||||||||||||||||||||||||
| 847 | - | |||||||||||||||||||||||||
| 848 | int QQmlDelegateModel::indexOf(QObject *item, QObject *) const | - | ||||||||||||||||||||||||
| 849 | { | - | ||||||||||||||||||||||||
| 850 | const QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 851 | if (QQmlDelegateModelItem *cacheItem = QQmlDelegateModelItem::dataForObject(item)
| 44930-54689 | ||||||||||||||||||||||||
| 852 | return executed 44930 times by 3 tests: cacheItem->groupIndex(d->m_compositorGroup);return cacheItem->groupIndex(d->m_compositorGroup);Executed by:
executed 44930 times by 3 tests: return cacheItem->groupIndex(d->m_compositorGroup);Executed by:
| 44930 | ||||||||||||||||||||||||
| 853 | return executed 54689 times by 10 tests: -1;return -1;Executed by:
executed 54689 times by 10 tests: return -1;Executed by:
| 54689 | ||||||||||||||||||||||||
| 854 | } | - | ||||||||||||||||||||||||
| 855 | - | |||||||||||||||||||||||||
| 856 | void QQmlDelegateModel::setWatchedRoles(const QList<QByteArray> &roles) | - | ||||||||||||||||||||||||
| 857 | { | - | ||||||||||||||||||||||||
| 858 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 859 | d->m_adaptorModel.replaceWatchedRoles(d->m_watchedRoles, roles); | - | ||||||||||||||||||||||||
| 860 | d->m_watchedRoles = roles; | - | ||||||||||||||||||||||||
| 861 | } executed 1620 times by 11 tests: end of blockExecuted by:
| 1620 | ||||||||||||||||||||||||
| 862 | - | |||||||||||||||||||||||||
| 863 | void QQmlDelegateModelPrivate::addGroups( | - | ||||||||||||||||||||||||
| 864 | Compositor::iterator from, int count, Compositor::Group group, int groupFlags) | - | ||||||||||||||||||||||||
| 865 | { | - | ||||||||||||||||||||||||
| 866 | QVector<Compositor::Insert> inserts; | - | ||||||||||||||||||||||||
| 867 | m_compositor.setFlags(from, count, group, groupFlags, &inserts); | - | ||||||||||||||||||||||||
| 868 | itemsInserted(inserts); | - | ||||||||||||||||||||||||
| 869 | emitChanges(); | - | ||||||||||||||||||||||||
| 870 | } executed 22 times by 1 test: end of blockExecuted by:
| 22 | ||||||||||||||||||||||||
| 871 | - | |||||||||||||||||||||||||
| 872 | void QQmlDelegateModelPrivate::removeGroups( | - | ||||||||||||||||||||||||
| 873 | Compositor::iterator from, int count, Compositor::Group group, int groupFlags) | - | ||||||||||||||||||||||||
| 874 | { | - | ||||||||||||||||||||||||
| 875 | QVector<Compositor::Remove> removes; | - | ||||||||||||||||||||||||
| 876 | m_compositor.clearFlags(from, count, group, groupFlags, &removes); | - | ||||||||||||||||||||||||
| 877 | itemsRemoved(removes); | - | ||||||||||||||||||||||||
| 878 | emitChanges(); | - | ||||||||||||||||||||||||
| 879 | } executed 40 times by 1 test: end of blockExecuted by:
| 40 | ||||||||||||||||||||||||
| 880 | - | |||||||||||||||||||||||||
| 881 | void QQmlDelegateModelPrivate::setGroups( | - | ||||||||||||||||||||||||
| 882 | Compositor::iterator from, int count, Compositor::Group group, int groupFlags) | - | ||||||||||||||||||||||||
| 883 | { | - | ||||||||||||||||||||||||
| 884 | QVector<Compositor::Remove> removes; | - | ||||||||||||||||||||||||
| 885 | QVector<Compositor::Insert> inserts; | - | ||||||||||||||||||||||||
| 886 | - | |||||||||||||||||||||||||
| 887 | m_compositor.setFlags(from, count, group, groupFlags, &inserts); | - | ||||||||||||||||||||||||
| 888 | itemsInserted(inserts); | - | ||||||||||||||||||||||||
| 889 | const int removeFlags = ~groupFlags & Compositor::GroupMask; | - | ||||||||||||||||||||||||
| 890 | - | |||||||||||||||||||||||||
| 891 | from = m_compositor.find(from.group, from.index[from.group]); | - | ||||||||||||||||||||||||
| 892 | m_compositor.clearFlags(from, count, group, removeFlags, &removes); | - | ||||||||||||||||||||||||
| 893 | itemsRemoved(removes); | - | ||||||||||||||||||||||||
| 894 | emitChanges(); | - | ||||||||||||||||||||||||
| 895 | } executed 36 times by 2 tests: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||
| 896 | - | |||||||||||||||||||||||||
| 897 | bool QQmlDelegateModel::event(QEvent *e) | - | ||||||||||||||||||||||||
| 898 | { | - | ||||||||||||||||||||||||
| 899 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 900 | if (e->type() == QEvent::UpdateRequest
| 18-19111 | ||||||||||||||||||||||||
| 901 | d->m_waitingToFetchMore = false; | - | ||||||||||||||||||||||||
| 902 | d->m_adaptorModel.fetchMore(); | - | ||||||||||||||||||||||||
| 903 | } executed 18 times by 1 test: else if (e->type() == QEvent::Userend of blockExecuted by:
| 18-12226 | ||||||||||||||||||||||||
| 904 | d->m_incubatorCleanupScheduled = false; | - | ||||||||||||||||||||||||
| 905 | qDeleteAll(d->m_finishedIncubating); | - | ||||||||||||||||||||||||
| 906 | d->m_finishedIncubating.clear(); | - | ||||||||||||||||||||||||
| 907 | } executed 6885 times by 22 tests: end of blockExecuted by:
| 6885 | ||||||||||||||||||||||||
| 908 | return executed 19129 times by 27 tests: QQmlInstanceModel::event(e);return QQmlInstanceModel::event(e);Executed by:
executed 19129 times by 27 tests: return QQmlInstanceModel::event(e);Executed by:
| 19129 | ||||||||||||||||||||||||
| 909 | } | - | ||||||||||||||||||||||||
| 910 | - | |||||||||||||||||||||||||
| 911 | void QQmlDelegateModelPrivate::itemsChanged(const QVector<Compositor::Change> &changes) | - | ||||||||||||||||||||||||
| 912 | { | - | ||||||||||||||||||||||||
| 913 | if (!m_delegate
| 0-426 | ||||||||||||||||||||||||
| 914 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 915 | - | |||||||||||||||||||||||||
| 916 | QVarLengthArray<QVector<QQmlChangeSet::Change>, Compositor::MaximumGroupCount> translatedChanges(m_groupCount); | - | ||||||||||||||||||||||||
| 917 | - | |||||||||||||||||||||||||
| 918 | for (const Compositor::Change &change : changes) { | - | ||||||||||||||||||||||||
| 919 | for (int i = 1; i < m_groupCount
| 426-852 | ||||||||||||||||||||||||
| 920 | if (change.inGroup(i)
| 426 | ||||||||||||||||||||||||
| 921 | translatedChanges[i].append(QQmlChangeSet::Change(change.index[i], change.count)); | - | ||||||||||||||||||||||||
| 922 | } executed 426 times by 2 tests: end of blockExecuted by:
| 426 | ||||||||||||||||||||||||
| 923 | } executed 852 times by 2 tests: end of blockExecuted by:
| 852 | ||||||||||||||||||||||||
| 924 | } executed 426 times by 2 tests: end of blockExecuted by:
| 426 | ||||||||||||||||||||||||
| 925 | - | |||||||||||||||||||||||||
| 926 | for (int i = 1; i < m_groupCount
| 426-852 | ||||||||||||||||||||||||
| 927 | QQmlDelegateModelGroupPrivate::get(m_groups[i])->changeSet.change(translatedChanges.at(i)); executed 852 times by 2 tests: QQmlDelegateModelGroupPrivate::get(m_groups[i])->changeSet.change(translatedChanges.at(i));Executed by:
| 852 | ||||||||||||||||||||||||
| 928 | } executed 426 times by 2 tests: end of blockExecuted by:
| 426 | ||||||||||||||||||||||||
| 929 | - | |||||||||||||||||||||||||
| 930 | void QQmlDelegateModel::_q_itemsChanged(int index, int count, const QVector<int> &roles) | - | ||||||||||||||||||||||||
| 931 | { | - | ||||||||||||||||||||||||
| 932 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 933 | if (count <= 0
| 0-494 | ||||||||||||||||||||||||
| 934 | return; executed 4 times by 1 test: return;Executed by:
| 4 | ||||||||||||||||||||||||
| 935 | - | |||||||||||||||||||||||||
| 936 | if (d->m_adaptorModel.notify(d->m_cache, index, count, roles)
| 68-426 | ||||||||||||||||||||||||
| 937 | QVector<Compositor::Change> changes; | - | ||||||||||||||||||||||||
| 938 | d->m_compositor.listItemsChanged(&d->m_adaptorModel, index, count, &changes); | - | ||||||||||||||||||||||||
| 939 | d->itemsChanged(changes); | - | ||||||||||||||||||||||||
| 940 | d->emitChanges(); | - | ||||||||||||||||||||||||
| 941 | } executed 426 times by 2 tests: end of blockExecuted by:
| 426 | ||||||||||||||||||||||||
| 942 | } executed 494 times by 5 tests: end of blockExecuted by:
| 494 | ||||||||||||||||||||||||
| 943 | - | |||||||||||||||||||||||||
| 944 | static void incrementIndexes(QQmlDelegateModelItem *cacheItem, int count, const int *deltas) | - | ||||||||||||||||||||||||
| 945 | { | - | ||||||||||||||||||||||||
| 946 | if (QQDMIncubationTask *incubationTask = cacheItem->incubationTask
| 322-120409 | ||||||||||||||||||||||||
| 947 | for (int i = 1; i < count
| 322-644 | ||||||||||||||||||||||||
| 948 | incubationTask->index[i] += deltas[i]; executed 644 times by 3 tests: incubationTask->index[i] += deltas[i];Executed by:
| 644 | ||||||||||||||||||||||||
| 949 | } executed 322 times by 3 tests: end of blockExecuted by:
| 322 | ||||||||||||||||||||||||
| 950 | if (QQmlDelegateModelAttached *attached = cacheItem->attached
| 2518-118213 | ||||||||||||||||||||||||
| 951 | for (int i = 1; i < qMin<int>(count, Compositor::MaximumGroupCount)
| 2518-10040 | ||||||||||||||||||||||||
| 952 | attached->m_currentIndex[i] += deltas[i]; executed 10040 times by 1 test: attached->m_currentIndex[i] += deltas[i];Executed by:
| 10040 | ||||||||||||||||||||||||
| 953 | } executed 2518 times by 1 test: end of blockExecuted by:
| 2518 | ||||||||||||||||||||||||
| 954 | } executed 120731 times by 8 tests: end of blockExecuted by:
| 120731 | ||||||||||||||||||||||||
| 955 | - | |||||||||||||||||||||||||
| 956 | void QQmlDelegateModelPrivate::itemsInserted( | - | ||||||||||||||||||||||||
| 957 | const QVector<Compositor::Insert> &inserts, | - | ||||||||||||||||||||||||
| 958 | QVarLengthArray<QVector<QQmlChangeSet::Change>, Compositor::MaximumGroupCount> *translatedInserts, | - | ||||||||||||||||||||||||
| 959 | QHash<int, QList<QQmlDelegateModelItem *> > *movedItems) | - | ||||||||||||||||||||||||
| 960 | { | - | ||||||||||||||||||||||||
| 961 | int cacheIndex = 0; | - | ||||||||||||||||||||||||
| 962 | - | |||||||||||||||||||||||||
| 963 | int inserted[Compositor::MaximumGroupCount]; | - | ||||||||||||||||||||||||
| 964 | for (int i = 1; i < m_groupCount
| 16130-36072 | ||||||||||||||||||||||||
| 965 | inserted[i] = 0; executed 36072 times by 27 tests: inserted[i] = 0;Executed by:
| 36072 | ||||||||||||||||||||||||
| 966 | - | |||||||||||||||||||||||||
| 967 | for (const Compositor::Insert &insert : inserts) { | - | ||||||||||||||||||||||||
| 968 | for (; cacheIndex < insert.cacheIndex
| 16086-45018 | ||||||||||||||||||||||||
| 969 | incrementIndexes(m_cache.at(cacheIndex), m_groupCount, inserted); executed 45018 times by 8 tests: incrementIndexes(m_cache.at(cacheIndex), m_groupCount, inserted);Executed by:
| 45018 | ||||||||||||||||||||||||
| 970 | - | |||||||||||||||||||||||||
| 971 | for (int i = 1; i < m_groupCount
| 16086-35768 | ||||||||||||||||||||||||
| 972 | if (insert.inGroup(i)
| 16816-18952 | ||||||||||||||||||||||||
| 973 | (*translatedInserts)[i].append( | - | ||||||||||||||||||||||||
| 974 | QQmlChangeSet::Change(insert.index[i], insert.count, insert.moveId)); | - | ||||||||||||||||||||||||
| 975 | inserted[i] += insert.count; | - | ||||||||||||||||||||||||
| 976 | } executed 16816 times by 27 tests: end of blockExecuted by:
| 16816 | ||||||||||||||||||||||||
| 977 | } executed 35768 times by 27 tests: end of blockExecuted by:
| 35768 | ||||||||||||||||||||||||
| 978 | - | |||||||||||||||||||||||||
| 979 | if (!insert.inCache()
| 1608-14478 | ||||||||||||||||||||||||
| 980 | continue; executed 14478 times by 27 tests: continue;Executed by:
| 14478 | ||||||||||||||||||||||||
| 981 | - | |||||||||||||||||||||||||
| 982 | if (movedItems
| 0-1018 | ||||||||||||||||||||||||
| 983 | QList<QQmlDelegateModelItem *> items = movedItems->take(insert.moveId); | - | ||||||||||||||||||||||||
| 984 | ((items.count() == insert.count) ? static_cast<void>(0) : qt_assert("items.count() == insert.count", __FILE__, 1262)); | - | ||||||||||||||||||||||||
| 985 | m_cache = m_cache.mid(0, insert.cacheIndex) + items + m_cache.mid(insert.cacheIndex); | - | ||||||||||||||||||||||||
| 986 | } executed 1018 times by 6 tests: end of blockExecuted by:
| 1018 | ||||||||||||||||||||||||
| 987 | if (insert.inGroup()
| 0-1608 | ||||||||||||||||||||||||
| 988 | for (int offset = 0; cacheIndex < insert.cacheIndex + insert.count
| 1608-2764 | ||||||||||||||||||||||||
| 989 | QQmlDelegateModelItem *cacheItem = m_cache.at(cacheIndex); | - | ||||||||||||||||||||||||
| 990 | cacheItem->groups |= insert.flags & Compositor::GroupMask; | - | ||||||||||||||||||||||||
| 991 | - | |||||||||||||||||||||||||
| 992 | if (QQDMIncubationTask *incubationTask = cacheItem->incubationTask
| 6-2758 | ||||||||||||||||||||||||
| 993 | for (int i = 1; i < m_groupCount
| 6-12 | ||||||||||||||||||||||||
| 994 | incubationTask->index[i] = cacheItem->groups & (1 << i)
executed 12 times by 2 tests: incubationTask->index[i] = cacheItem->groups & (1 << i) ? insert.index[i] + offset : insert.index[i];Executed by:
| 6-12 | ||||||||||||||||||||||||
| 995 | ? insert.index[i] + offset executed 12 times by 2 tests: incubationTask->index[i] = cacheItem->groups & (1 << i) ? insert.index[i] + offset : insert.index[i];Executed by:
| 12 | ||||||||||||||||||||||||
| 996 | : insert.index[i]; executed 12 times by 2 tests: incubationTask->index[i] = cacheItem->groups & (1 << i) ? insert.index[i] + offset : insert.index[i];Executed by:
| 12 | ||||||||||||||||||||||||
| 997 | } executed 6 times by 2 tests: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 998 | if (QQmlDelegateModelAttached *attached = cacheItem->attached
| 100-2664 | ||||||||||||||||||||||||
| 999 | for (int i = 1; i < m_groupCount
| 100-388 | ||||||||||||||||||||||||
| 1000 | attached->m_currentIndex[i] = cacheItem->groups & (1 << i)
executed 388 times by 2 tests: attached->m_currentIndex[i] = cacheItem->groups & (1 << i) ? insert.index[i] + offset : insert.index[i];Executed by:
| 164-388 | ||||||||||||||||||||||||
| 1001 | ? insert.index[i] + offset executed 388 times by 2 tests: attached->m_currentIndex[i] = cacheItem->groups & (1 << i) ? insert.index[i] + offset : insert.index[i];Executed by:
| 388 | ||||||||||||||||||||||||
| 1002 | : insert.index[i]; executed 388 times by 2 tests: attached->m_currentIndex[i] = cacheItem->groups & (1 << i) ? insert.index[i] + offset : insert.index[i];Executed by:
| 388 | ||||||||||||||||||||||||
| 1003 | } executed 100 times by 2 tests: end of blockExecuted by:
| 100 | ||||||||||||||||||||||||
| 1004 | } executed 2764 times by 6 tests: end of blockExecuted by:
| 2764 | ||||||||||||||||||||||||
| 1005 | } executed 1608 times by 6 tests: else {end of blockExecuted by:
| 1608 | ||||||||||||||||||||||||
| 1006 | cacheIndex = insert.cacheIndex + insert.count; | - | ||||||||||||||||||||||||
| 1007 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1008 | } | - | ||||||||||||||||||||||||
| 1009 | for (const QList<QQmlDelegateModelItem *> cache = m_cache; cacheIndex < cache.count()
| 16130-25798 | ||||||||||||||||||||||||
| 1010 | incrementIndexes(cache.at(cacheIndex), m_groupCount, inserted); executed 25798 times by 8 tests: incrementIndexes(cache.at(cacheIndex), m_groupCount, inserted);Executed by:
| 25798 | ||||||||||||||||||||||||
| 1011 | } executed 16130 times by 27 tests: end of blockExecuted by:
| 16130 | ||||||||||||||||||||||||
| 1012 | - | |||||||||||||||||||||||||
| 1013 | void QQmlDelegateModelPrivate::itemsInserted(const QVector<Compositor::Insert> &inserts) | - | ||||||||||||||||||||||||
| 1014 | { | - | ||||||||||||||||||||||||
| 1015 | QVarLengthArray<QVector<QQmlChangeSet::Change>, Compositor::MaximumGroupCount> translatedInserts(m_groupCount); | - | ||||||||||||||||||||||||
| 1016 | itemsInserted(inserts, &translatedInserts); | - | ||||||||||||||||||||||||
| 1017 | ((m_cache.count() == m_compositor.count(Compositor::Cache)) ? static_cast<void>(0) : qt_assert("m_cache.count() == m_compositor.count(Compositor::Cache)", __FILE__, 1295)); | - | ||||||||||||||||||||||||
| 1018 | if (!m_delegate
| 42-14782 | ||||||||||||||||||||||||
| 1019 | return; executed 42 times by 7 tests: return;Executed by:
| 42 | ||||||||||||||||||||||||
| 1020 | - | |||||||||||||||||||||||||
| 1021 | for (int i = 1; i < m_groupCount
| 14782-33018 | ||||||||||||||||||||||||
| 1022 | QQmlDelegateModelGroupPrivate::get(m_groups[i])->changeSet.insert(translatedInserts.at(i)); executed 33018 times by 26 tests: QQmlDelegateModelGroupPrivate::get(m_groups[i])->changeSet.insert(translatedInserts.at(i));Executed by:
| 33018 | ||||||||||||||||||||||||
| 1023 | } executed 14782 times by 26 tests: end of blockExecuted by:
| 14782 | ||||||||||||||||||||||||
| 1024 | - | |||||||||||||||||||||||||
| 1025 | void QQmlDelegateModel::_q_itemsInserted(int index, int count) | - | ||||||||||||||||||||||||
| 1026 | { | - | ||||||||||||||||||||||||
| 1027 | - | |||||||||||||||||||||||||
| 1028 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1029 | if (count <= 0
| 72-8148 | ||||||||||||||||||||||||
| 1030 | return; executed 232 times by 10 tests: return;Executed by:
| 232 | ||||||||||||||||||||||||
| 1031 | - | |||||||||||||||||||||||||
| 1032 | d->m_count += count; | - | ||||||||||||||||||||||||
| 1033 | - | |||||||||||||||||||||||||
| 1034 | const QList<QQmlDelegateModelItem *> cache = d->m_cache; | - | ||||||||||||||||||||||||
| 1035 | for (int i = 0, c = cache.count(); i < c
| 8076-48762 | ||||||||||||||||||||||||
| 1036 | QQmlDelegateModelItem *item = cache.at(i); | - | ||||||||||||||||||||||||
| 1037 | if (item->modelIndex() >= index
| 12234-36528 | ||||||||||||||||||||||||
| 1038 | item->setModelIndex(item->modelIndex() + count); executed 12234 times by 7 tests: item->setModelIndex(item->modelIndex() + count);Executed by:
| 12234 | ||||||||||||||||||||||||
| 1039 | } executed 48762 times by 7 tests: end of blockExecuted by:
| 48762 | ||||||||||||||||||||||||
| 1040 | - | |||||||||||||||||||||||||
| 1041 | QVector<Compositor::Insert> inserts; | - | ||||||||||||||||||||||||
| 1042 | d->m_compositor.listItemsInserted(&d->m_adaptorModel, index, count, &inserts); | - | ||||||||||||||||||||||||
| 1043 | d->itemsInserted(inserts); | - | ||||||||||||||||||||||||
| 1044 | d->emitChanges(); | - | ||||||||||||||||||||||||
| 1045 | } executed 8076 times by 13 tests: end of blockExecuted by:
| 8076 | ||||||||||||||||||||||||
| 1046 | void QQmlDelegateModelPrivate::itemsRemoved( | - | ||||||||||||||||||||||||
| 1047 | const QVector<Compositor::Remove> &removes, | - | ||||||||||||||||||||||||
| 1048 | QVarLengthArray<QVector<QQmlChangeSet::Change>, Compositor::MaximumGroupCount> *translatedRemoves, | - | ||||||||||||||||||||||||
| 1049 | QHash<int, QList<QQmlDelegateModelItem *> > *movedItems) | - | ||||||||||||||||||||||||
| 1050 | { | - | ||||||||||||||||||||||||
| 1051 | int cacheIndex = 0; | - | ||||||||||||||||||||||||
| 1052 | int removedCache = 0; | - | ||||||||||||||||||||||||
| 1053 | - | |||||||||||||||||||||||||
| 1054 | int removed[Compositor::MaximumGroupCount]; | - | ||||||||||||||||||||||||
| 1055 | for (int i = 1; i < m_groupCount
| 4074-8912 | ||||||||||||||||||||||||
| 1056 | removed[i] = 0; executed 8912 times by 12 tests: removed[i] = 0;Executed by:
| 8912 | ||||||||||||||||||||||||
| 1057 | - | |||||||||||||||||||||||||
| 1058 | for (const Compositor::Remove &remove : removes) { | - | ||||||||||||||||||||||||
| 1059 | for (; cacheIndex < remove.cacheIndex
| 4484-21509 | ||||||||||||||||||||||||
| 1060 | incrementIndexes(m_cache.at(cacheIndex), m_groupCount, removed); executed 21509 times by 6 tests: incrementIndexes(m_cache.at(cacheIndex), m_groupCount, removed);Executed by:
| 21509 | ||||||||||||||||||||||||
| 1061 | - | |||||||||||||||||||||||||
| 1062 | for (int i = 1; i < m_groupCount
| 4484-9788 | ||||||||||||||||||||||||
| 1063 | if (remove.inGroup(i)
| 4688-5100 | ||||||||||||||||||||||||
| 1064 | (*translatedRemoves)[i].append( | - | ||||||||||||||||||||||||
| 1065 | QQmlChangeSet::Change(remove.index[i], remove.count, remove.moveId)); | - | ||||||||||||||||||||||||
| 1066 | removed[i] -= remove.count; | - | ||||||||||||||||||||||||
| 1067 | } executed 4688 times by 12 tests: end of blockExecuted by:
| 4688 | ||||||||||||||||||||||||
| 1068 | } executed 9788 times by 12 tests: end of blockExecuted by:
| 9788 | ||||||||||||||||||||||||
| 1069 | - | |||||||||||||||||||||||||
| 1070 | if (!remove.inCache()
| 1221-3263 | ||||||||||||||||||||||||
| 1071 | continue; executed 1221 times by 9 tests: continue;Executed by:
| 1221 | ||||||||||||||||||||||||
| 1072 | - | |||||||||||||||||||||||||
| 1073 | if (movedItems
| 44-2201 | ||||||||||||||||||||||||
| 1074 | movedItems->insert(remove.moveId, m_cache.mid(remove.cacheIndex, remove.count)); | - | ||||||||||||||||||||||||
| 1075 | QList<QQmlDelegateModelItem *>::iterator begin = m_cache.begin() + remove.cacheIndex; | - | ||||||||||||||||||||||||
| 1076 | QList<QQmlDelegateModelItem *>::iterator end = begin + remove.count; | - | ||||||||||||||||||||||||
| 1077 | m_cache.erase(begin, end); | - | ||||||||||||||||||||||||
| 1078 | } executed 1018 times by 6 tests: else {end of blockExecuted by:
| 1018 | ||||||||||||||||||||||||
| 1079 | for (; cacheIndex < remove.cacheIndex + remove.count - removedCache
| 2245-5184 | ||||||||||||||||||||||||
| 1080 | QQmlDelegateModelItem *cacheItem = m_cache.at(cacheIndex); | - | ||||||||||||||||||||||||
| 1081 | if (remove.inGroup(Compositor::Persisted)
| 12-5140 | ||||||||||||||||||||||||
| 1082 | QObject *object = cacheItem->object; | - | ||||||||||||||||||||||||
| 1083 | cacheItem->destroyObject(); | - | ||||||||||||||||||||||||
| 1084 | if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(object)
| 4-6 | ||||||||||||||||||||||||
| 1085 | emitDestroyingPackage(package); executed 4 times by 1 test: emitDestroyingPackage(package);Executed by:
| 4 | ||||||||||||||||||||||||
| 1086 | else | - | ||||||||||||||||||||||||
| 1087 | emitDestroyingItem(object); executed 6 times by 1 test: emitDestroyingItem(object);Executed by:
| 6 | ||||||||||||||||||||||||
| 1088 | cacheItem->scriptRef -= 1; | - | ||||||||||||||||||||||||
| 1089 | } executed 10 times by 1 test: end of blockExecuted by:
| 10 | ||||||||||||||||||||||||
| 1090 | if (!cacheItem->isReferenced()
| 2-5182 | ||||||||||||||||||||||||
| 1091 | m_compositor.clearFlags(Compositor::Cache, cacheIndex, 1, Compositor::CacheFlag); | - | ||||||||||||||||||||||||
| 1092 | m_cache.removeAt(cacheIndex); | - | ||||||||||||||||||||||||
| 1093 | delete cacheItem; | - | ||||||||||||||||||||||||
| 1094 | --cacheIndex; | - | ||||||||||||||||||||||||
| 1095 | ++removedCache; | - | ||||||||||||||||||||||||
| 1096 | ((m_cache.count() == m_compositor.count(Compositor::Cache)) ? static_cast<void>(0) : qt_assert("m_cache.count() == m_compositor.count(Compositor::Cache)", __FILE__, 1382)); | - | ||||||||||||||||||||||||
| 1097 | } executed 2 times by 1 test: else if (remove.groups() == cacheItem->groupsend of blockExecuted by:
| 0-5182 | ||||||||||||||||||||||||
| 1098 | cacheItem->groups = 0; | - | ||||||||||||||||||||||||
| 1099 | if (QQDMIncubationTask *incubationTask = cacheItem->incubationTask
| 0 | ||||||||||||||||||||||||
| 1100 | for (int i = 1; i < m_groupCount
| 0 | ||||||||||||||||||||||||
| 1101 | incubationTask->index[i] = -1; never executed: incubationTask->index[i] = -1; | 0 | ||||||||||||||||||||||||
| 1102 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1103 | if (QQmlDelegateModelAttached *attached = cacheItem->attached
| 0 | ||||||||||||||||||||||||
| 1104 | for (int i = 1; i < m_groupCount
| 0 | ||||||||||||||||||||||||
| 1105 | attached->m_currentIndex[i] = -1; never executed: attached->m_currentIndex[i] = -1; | 0 | ||||||||||||||||||||||||
| 1106 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1107 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1108 | if (QQDMIncubationTask *incubationTask = cacheItem->incubationTask
| 21-5161 | ||||||||||||||||||||||||
| 1109 | if (!cacheItem->isObjectReferenced()
| 2-19 | ||||||||||||||||||||||||
| 1110 | releaseIncubator(cacheItem->incubationTask); | - | ||||||||||||||||||||||||
| 1111 | cacheItem->incubationTask = nullptr; | - | ||||||||||||||||||||||||
| 1112 | if (cacheItem->object
| 0-19 | ||||||||||||||||||||||||
| 1113 | QObject *object = cacheItem->object; | - | ||||||||||||||||||||||||
| 1114 | cacheItem->destroyObject(); | - | ||||||||||||||||||||||||
| 1115 | if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(object)
| 0 | ||||||||||||||||||||||||
| 1116 | emitDestroyingPackage(package); never executed: emitDestroyingPackage(package); | 0 | ||||||||||||||||||||||||
| 1117 | else | - | ||||||||||||||||||||||||
| 1118 | emitDestroyingItem(object); never executed: emitDestroyingItem(object); | 0 | ||||||||||||||||||||||||
| 1119 | } | - | ||||||||||||||||||||||||
| 1120 | cacheItem->scriptRef -= 1; | - | ||||||||||||||||||||||||
| 1121 | } executed 19 times by 3 tests: else {end of blockExecuted by:
| 19 | ||||||||||||||||||||||||
| 1122 | for (int i = 1; i < m_groupCount
| 2-4 | ||||||||||||||||||||||||
| 1123 | if (remove.inGroup(i)
| 2 | ||||||||||||||||||||||||
| 1124 | incubationTask->index[i] = remove.index[i]; executed 2 times by 1 test: incubationTask->index[i] = remove.index[i];Executed by:
| 2 | ||||||||||||||||||||||||
| 1125 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 1126 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 1127 | } | - | ||||||||||||||||||||||||
| 1128 | if (QQmlDelegateModelAttached *attached = cacheItem->attached
| 60-5122 | ||||||||||||||||||||||||
| 1129 | for (int i = 1; i < m_groupCount
| 60-224 | ||||||||||||||||||||||||
| 1130 | if (remove.inGroup(i)
| 72-152 | ||||||||||||||||||||||||
| 1131 | attached->m_currentIndex[i] = remove.index[i]; executed 72 times by 1 test: attached->m_currentIndex[i] = remove.index[i];Executed by:
| 72 | ||||||||||||||||||||||||
| 1132 | } executed 224 times by 1 test: end of blockExecuted by:
| 224 | ||||||||||||||||||||||||
| 1133 | } executed 60 times by 1 test: end of blockExecuted by:
| 60 | ||||||||||||||||||||||||
| 1134 | cacheItem->groups &= ~remove.flags; | - | ||||||||||||||||||||||||
| 1135 | } executed 5182 times by 8 tests: end of blockExecuted by:
| 5182 | ||||||||||||||||||||||||
| 1136 | } | - | ||||||||||||||||||||||||
| 1137 | } executed 2245 times by 8 tests: end of blockExecuted by:
| 2245 | ||||||||||||||||||||||||
| 1138 | } | - | ||||||||||||||||||||||||
| 1139 | - | |||||||||||||||||||||||||
| 1140 | for (const QList<QQmlDelegateModelItem *> cache = m_cache; cacheIndex < cache.count()
| 4074-28406 | ||||||||||||||||||||||||
| 1141 | incrementIndexes(cache.at(cacheIndex), m_groupCount, removed); executed 28406 times by 8 tests: incrementIndexes(cache.at(cacheIndex), m_groupCount, removed);Executed by:
| 28406 | ||||||||||||||||||||||||
| 1142 | } executed 4074 times by 12 tests: end of blockExecuted by:
| 4074 | ||||||||||||||||||||||||
| 1143 | - | |||||||||||||||||||||||||
| 1144 | void QQmlDelegateModelPrivate::itemsRemoved(const QVector<Compositor::Remove> &removes) | - | ||||||||||||||||||||||||
| 1145 | { | - | ||||||||||||||||||||||||
| 1146 | QVarLengthArray<QVector<QQmlChangeSet::Change>, Compositor::MaximumGroupCount> translatedRemoves(m_groupCount); | - | ||||||||||||||||||||||||
| 1147 | itemsRemoved(removes, &translatedRemoves); | - | ||||||||||||||||||||||||
| 1148 | ((m_cache.count() == m_compositor.count(Compositor::Cache)) ? static_cast<void>(0) : qt_assert("m_cache.count() == m_compositor.count(Compositor::Cache)", __FILE__, 1434)); | - | ||||||||||||||||||||||||
| 1149 | if (!m_delegate
| 4-2764 | ||||||||||||||||||||||||
| 1150 | return; executed 4 times by 1 test: return;Executed by:
| 4 | ||||||||||||||||||||||||
| 1151 | - | |||||||||||||||||||||||||
| 1152 | for (int i = 1; i < m_groupCount
| 2764-5938 | ||||||||||||||||||||||||
| 1153 | QQmlDelegateModelGroupPrivate::get(m_groups[i])->changeSet.remove(translatedRemoves.at(i)); executed 5938 times by 12 tests: QQmlDelegateModelGroupPrivate::get(m_groups[i])->changeSet.remove(translatedRemoves.at(i));Executed by:
| 5938 | ||||||||||||||||||||||||
| 1154 | } executed 2764 times by 12 tests: end of blockExecuted by:
| 2764 | ||||||||||||||||||||||||
| 1155 | - | |||||||||||||||||||||||||
| 1156 | void QQmlDelegateModel::_q_itemsRemoved(int index, int count) | - | ||||||||||||||||||||||||
| 1157 | { | - | ||||||||||||||||||||||||
| 1158 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1159 | if (count <= 0
| 0-2558 | ||||||||||||||||||||||||
| 1160 | return; executed 390 times by 10 tests: return;Executed by:
| 390 | ||||||||||||||||||||||||
| 1161 | - | |||||||||||||||||||||||||
| 1162 | d->m_count -= count; | - | ||||||||||||||||||||||||
| 1163 | const QList<QQmlDelegateModelItem *> cache = d->m_cache; | - | ||||||||||||||||||||||||
| 1164 | for (int i = 0, c = cache.count(); i < c
| 2558-36723 | ||||||||||||||||||||||||
| 1165 | QQmlDelegateModelItem *item = cache.at(i); | - | ||||||||||||||||||||||||
| 1166 | - | |||||||||||||||||||||||||
| 1167 | - | |||||||||||||||||||||||||
| 1168 | if (!d->m_cache.contains(item)
| 0-36723 | ||||||||||||||||||||||||
| 1169 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 1170 | - | |||||||||||||||||||||||||
| 1171 | if (item->modelIndex() >= index + count
| 14731-21992 | ||||||||||||||||||||||||
| 1172 | item->setModelIndex(item->modelIndex() - count); executed 14731 times by 7 tests: item->setModelIndex(item->modelIndex() - count);Executed by:
| 14731 | ||||||||||||||||||||||||
| 1173 | else if (item->modelIndex() >= index
| 4482-17510 | ||||||||||||||||||||||||
| 1174 | item->setModelIndex(-1); executed 4482 times by 7 tests: item->setModelIndex(-1);Executed by:
| 4482 | ||||||||||||||||||||||||
| 1175 | } executed 36723 times by 7 tests: end of blockExecuted by:
| 36723 | ||||||||||||||||||||||||
| 1176 | - | |||||||||||||||||||||||||
| 1177 | QVector<Compositor::Remove> removes; | - | ||||||||||||||||||||||||
| 1178 | d->m_compositor.listItemsRemoved(&d->m_adaptorModel, index, count, &removes); | - | ||||||||||||||||||||||||
| 1179 | d->itemsRemoved(removes); | - | ||||||||||||||||||||||||
| 1180 | - | |||||||||||||||||||||||||
| 1181 | d->emitChanges(); | - | ||||||||||||||||||||||||
| 1182 | } executed 2558 times by 11 tests: end of blockExecuted by:
| 2558 | ||||||||||||||||||||||||
| 1183 | - | |||||||||||||||||||||||||
| 1184 | void QQmlDelegateModelPrivate::itemsMoved( | - | ||||||||||||||||||||||||
| 1185 | const QVector<Compositor::Remove> &removes, const QVector<Compositor::Insert> &inserts) | - | ||||||||||||||||||||||||
| 1186 | { | - | ||||||||||||||||||||||||
| 1187 | QHash<int, QList<QQmlDelegateModelItem *> > movedItems; | - | ||||||||||||||||||||||||
| 1188 | - | |||||||||||||||||||||||||
| 1189 | QVarLengthArray<QVector<QQmlChangeSet::Change>, Compositor::MaximumGroupCount> translatedRemoves(m_groupCount); | - | ||||||||||||||||||||||||
| 1190 | itemsRemoved(removes, &translatedRemoves, &movedItems); | - | ||||||||||||||||||||||||
| 1191 | - | |||||||||||||||||||||||||
| 1192 | QVarLengthArray<QVector<QQmlChangeSet::Change>, Compositor::MaximumGroupCount> translatedInserts(m_groupCount); | - | ||||||||||||||||||||||||
| 1193 | itemsInserted(inserts, &translatedInserts, &movedItems); | - | ||||||||||||||||||||||||
| 1194 | ((m_cache.count() == m_compositor.count(Compositor::Cache)) ? static_cast<void>(0) : qt_assert("m_cache.count() == m_compositor.count(Compositor::Cache)", __FILE__, 1480)); | - | ||||||||||||||||||||||||
| 1195 | ((movedItems.isEmpty()) ? static_cast<void>(0) : qt_assert("movedItems.isEmpty()", __FILE__, 1481)); | - | ||||||||||||||||||||||||
| 1196 | if (!m_delegate
| 0-1306 | ||||||||||||||||||||||||
| 1197 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1198 | - | |||||||||||||||||||||||||
| 1199 | for (int i = 1; i < m_groupCount
| 1306-2966 | ||||||||||||||||||||||||
| 1200 | QQmlDelegateModelGroupPrivate::get(m_groups[i])->changeSet.move( | - | ||||||||||||||||||||||||
| 1201 | translatedRemoves.at(i), | - | ||||||||||||||||||||||||
| 1202 | translatedInserts.at(i)); | - | ||||||||||||||||||||||||
| 1203 | } executed 2966 times by 6 tests: end of blockExecuted by:
| 2966 | ||||||||||||||||||||||||
| 1204 | } executed 1306 times by 6 tests: end of blockExecuted by:
| 1306 | ||||||||||||||||||||||||
| 1205 | - | |||||||||||||||||||||||||
| 1206 | void QQmlDelegateModel::_q_itemsMoved(int from, int to, int count) | - | ||||||||||||||||||||||||
| 1207 | { | - | ||||||||||||||||||||||||
| 1208 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1209 | if (count <= 0
| 0-1080 | ||||||||||||||||||||||||
| 1210 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1211 | - | |||||||||||||||||||||||||
| 1212 | const int minimum = qMin(from, to); | - | ||||||||||||||||||||||||
| 1213 | const int maximum = qMax(from, to) + count; | - | ||||||||||||||||||||||||
| 1214 | const int difference = from > to
| 534-546 | ||||||||||||||||||||||||
| 1215 | - | |||||||||||||||||||||||||
| 1216 | const QList<QQmlDelegateModelItem *> cache = d->m_cache; | - | ||||||||||||||||||||||||
| 1217 | for (int i = 0, c = cache.count(); i < c
| 1080-17670 | ||||||||||||||||||||||||
| 1218 | QQmlDelegateModelItem *item = cache.at(i); | - | ||||||||||||||||||||||||
| 1219 | if (item->modelIndex() >= from
| 1958-11564 | ||||||||||||||||||||||||
| 1220 | item->setModelIndex(item->modelIndex() - from + to); executed 1958 times by 5 tests: item->setModelIndex(item->modelIndex() - from + to);Executed by:
| 1958 | ||||||||||||||||||||||||
| 1221 | else if (item->modelIndex() >= minimum
| 2336-13376 | ||||||||||||||||||||||||
| 1222 | item->setModelIndex(item->modelIndex() + difference); executed 8144 times by 5 tests: item->setModelIndex(item->modelIndex() + difference);Executed by:
| 8144 | ||||||||||||||||||||||||
| 1223 | } executed 17670 times by 5 tests: end of blockExecuted by:
| 17670 | ||||||||||||||||||||||||
| 1224 | - | |||||||||||||||||||||||||
| 1225 | QVector<Compositor::Remove> removes; | - | ||||||||||||||||||||||||
| 1226 | QVector<Compositor::Insert> inserts; | - | ||||||||||||||||||||||||
| 1227 | d->m_compositor.listItemsMoved(&d->m_adaptorModel, from, to, count, &removes, &inserts); | - | ||||||||||||||||||||||||
| 1228 | d->itemsMoved(removes, inserts); | - | ||||||||||||||||||||||||
| 1229 | d->emitChanges(); | - | ||||||||||||||||||||||||
| 1230 | } executed 1080 times by 5 tests: end of blockExecuted by:
| 1080 | ||||||||||||||||||||||||
| 1231 | - | |||||||||||||||||||||||||
| 1232 | void QQmlDelegateModelPrivate::emitModelUpdated(const QQmlChangeSet &changeSet, bool reset) | - | ||||||||||||||||||||||||
| 1233 | { | - | ||||||||||||||||||||||||
| 1234 | QQmlDelegateModel * const q = q_func(); | - | ||||||||||||||||||||||||
| 1235 | q->modelUpdated(changeSet, reset); | - | ||||||||||||||||||||||||
| 1236 | if (changeSet.difference() != 0
| 3630-15250 | ||||||||||||||||||||||||
| 1237 | q->countChanged(); executed 15250 times by 25 tests: q->countChanged();Executed by:
| 15250 | ||||||||||||||||||||||||
| 1238 | } executed 18880 times by 27 tests: end of blockExecuted by:
| 18880 | ||||||||||||||||||||||||
| 1239 | - | |||||||||||||||||||||||||
| 1240 | void QQmlDelegateModelPrivate::emitChanges() | - | ||||||||||||||||||||||||
| 1241 | { | - | ||||||||||||||||||||||||
| 1242 | if (m_transaction
| 0-24480 | ||||||||||||||||||||||||
| 1243 | return; executed 5636 times by 26 tests: return;Executed by:
| 5636 | ||||||||||||||||||||||||
| 1244 | - | |||||||||||||||||||||||||
| 1245 | m_transaction = true; | - | ||||||||||||||||||||||||
| 1246 | QV4::ExecutionEngine *engine = m_context->engine()->handle(); | - | ||||||||||||||||||||||||
| 1247 | for (int i = 1; i < m_groupCount
| 18880-41120 | ||||||||||||||||||||||||
| 1248 | QQmlDelegateModelGroupPrivate::get(m_groups[i])->emitChanges(engine); executed 41120 times by 27 tests: QQmlDelegateModelGroupPrivate::get(m_groups[i])->emitChanges(engine);Executed by:
| 41120 | ||||||||||||||||||||||||
| 1249 | m_transaction = false; | - | ||||||||||||||||||||||||
| 1250 | - | |||||||||||||||||||||||||
| 1251 | const bool reset = m_reset; | - | ||||||||||||||||||||||||
| 1252 | m_reset = false; | - | ||||||||||||||||||||||||
| 1253 | for (int i = 1; i < m_groupCount
| 18880-41120 | ||||||||||||||||||||||||
| 1254 | QQmlDelegateModelGroupPrivate::get(m_groups[i])->emitModelUpdated(reset); executed 41120 times by 27 tests: QQmlDelegateModelGroupPrivate::get(m_groups[i])->emitModelUpdated(reset);Executed by:
| 41120 | ||||||||||||||||||||||||
| 1255 | - | |||||||||||||||||||||||||
| 1256 | auto cacheCopy = m_cache; | - | ||||||||||||||||||||||||
| 1257 | for (QQmlDelegateModelItem *cacheItem : qAsConst(cacheCopy)) { | - | ||||||||||||||||||||||||
| 1258 | if (cacheItem->attached
| 2324-113699 | ||||||||||||||||||||||||
| 1259 | cacheItem->attached->emitChanges(); executed 2324 times by 2 tests: cacheItem->attached->emitChanges();Executed by:
| 2324 | ||||||||||||||||||||||||
| 1260 | } executed 116023 times by 8 tests: end of blockExecuted by:
| 116023 | ||||||||||||||||||||||||
| 1261 | } executed 18880 times by 27 tests: end of blockExecuted by:
| 18880 | ||||||||||||||||||||||||
| 1262 | - | |||||||||||||||||||||||||
| 1263 | void QQmlDelegateModel::_q_modelReset() | - | ||||||||||||||||||||||||
| 1264 | { | - | ||||||||||||||||||||||||
| 1265 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1266 | if (!d->m_delegate
| 0-54 | ||||||||||||||||||||||||
| 1267 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1268 | - | |||||||||||||||||||||||||
| 1269 | int oldCount = d->m_count; | - | ||||||||||||||||||||||||
| 1270 | d->m_adaptorModel.rootIndex = QModelIndex(); | - | ||||||||||||||||||||||||
| 1271 | - | |||||||||||||||||||||||||
| 1272 | if (d->m_complete
| 2-52 | ||||||||||||||||||||||||
| 1273 | d->m_count = d->adaptorModelCount(); | - | ||||||||||||||||||||||||
| 1274 | - | |||||||||||||||||||||||||
| 1275 | const QList<QQmlDelegateModelItem *> cache = d->m_cache; | - | ||||||||||||||||||||||||
| 1276 | for (int i = 0, c = cache.count(); i < c
| 52-516 | ||||||||||||||||||||||||
| 1277 | QQmlDelegateModelItem *item = cache.at(i); | - | ||||||||||||||||||||||||
| 1278 | if (item->modelIndex() != -1
| 0-516 | ||||||||||||||||||||||||
| 1279 | item->setModelIndex(-1); executed 516 times by 4 tests: item->setModelIndex(-1);Executed by:
| 516 | ||||||||||||||||||||||||
| 1280 | } executed 516 times by 4 tests: end of blockExecuted by:
| 516 | ||||||||||||||||||||||||
| 1281 | - | |||||||||||||||||||||||||
| 1282 | QVector<Compositor::Remove> removes; | - | ||||||||||||||||||||||||
| 1283 | QVector<Compositor::Insert> inserts; | - | ||||||||||||||||||||||||
| 1284 | if (oldCount
| 8-44 | ||||||||||||||||||||||||
| 1285 | d->m_compositor.listItemsRemoved(&d->m_adaptorModel, 0, oldCount, &removes); executed 44 times by 4 tests: d->m_compositor.listItemsRemoved(&d->m_adaptorModel, 0, oldCount, &removes);Executed by:
| 44 | ||||||||||||||||||||||||
| 1286 | if (d->m_count
| 6-46 | ||||||||||||||||||||||||
| 1287 | d->m_compositor.listItemsInserted(&d->m_adaptorModel, 0, d->m_count, &inserts); executed 46 times by 4 tests: d->m_compositor.listItemsInserted(&d->m_adaptorModel, 0, d->m_count, &inserts);Executed by:
| 46 | ||||||||||||||||||||||||
| 1288 | d->itemsMoved(removes, inserts); | - | ||||||||||||||||||||||||
| 1289 | d->m_reset = true; | - | ||||||||||||||||||||||||
| 1290 | - | |||||||||||||||||||||||||
| 1291 | if (d->m_adaptorModel.canFetchMore()
| 0-52 | ||||||||||||||||||||||||
| 1292 | d->m_adaptorModel.fetchMore(); never executed: d->m_adaptorModel.fetchMore(); | 0 | ||||||||||||||||||||||||
| 1293 | - | |||||||||||||||||||||||||
| 1294 | d->emitChanges(); | - | ||||||||||||||||||||||||
| 1295 | } executed 52 times by 5 tests: end of blockExecuted by:
| 52 | ||||||||||||||||||||||||
| 1296 | rootIndexChanged(); | - | ||||||||||||||||||||||||
| 1297 | } executed 54 times by 5 tests: end of blockExecuted by:
| 54 | ||||||||||||||||||||||||
| 1298 | - | |||||||||||||||||||||||||
| 1299 | void QQmlDelegateModel::_q_rowsInserted(const QModelIndex &parent, int begin, int end) | - | ||||||||||||||||||||||||
| 1300 | { | - | ||||||||||||||||||||||||
| 1301 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1302 | if (parent == d->m_adaptorModel.rootIndex
| 2-7638 | ||||||||||||||||||||||||
| 1303 | _q_itemsInserted(begin, end - begin + 1); executed 7638 times by 8 tests: _q_itemsInserted(begin, end - begin + 1);Executed by:
| 7638 | ||||||||||||||||||||||||
| 1304 | } executed 7640 times by 8 tests: end of blockExecuted by:
| 7640 | ||||||||||||||||||||||||
| 1305 | - | |||||||||||||||||||||||||
| 1306 | void QQmlDelegateModel::_q_rowsAboutToBeRemoved(const QModelIndex &parent, int begin, int end) | - | ||||||||||||||||||||||||
| 1307 | { | - | ||||||||||||||||||||||||
| 1308 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1309 | if (!d->m_adaptorModel.rootIndex.isValid()
| 8-2272 | ||||||||||||||||||||||||
| 1310 | return; executed 2272 times by 7 tests: return;Executed by:
| 2272 | ||||||||||||||||||||||||
| 1311 | const QModelIndex index = d->m_adaptorModel.rootIndex; | - | ||||||||||||||||||||||||
| 1312 | if (index.parent() == parent
| 0-4 | ||||||||||||||||||||||||
| 1313 | const int oldCount = d->m_count; | - | ||||||||||||||||||||||||
| 1314 | d->m_count = 0; | - | ||||||||||||||||||||||||
| 1315 | d->m_adaptorModel.invalidateModel(this); | - | ||||||||||||||||||||||||
| 1316 | - | |||||||||||||||||||||||||
| 1317 | if (d->m_complete
| 0-2 | ||||||||||||||||||||||||
| 1318 | QVector<Compositor::Remove> removes; | - | ||||||||||||||||||||||||
| 1319 | d->m_compositor.listItemsRemoved(&d->m_adaptorModel, 0, oldCount, &removes); | - | ||||||||||||||||||||||||
| 1320 | d->itemsRemoved(removes); | - | ||||||||||||||||||||||||
| 1321 | d->emitChanges(); | - | ||||||||||||||||||||||||
| 1322 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 1323 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 1324 | } executed 8 times by 1 test: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 1325 | - | |||||||||||||||||||||||||
| 1326 | void QQmlDelegateModel::_q_rowsRemoved(const QModelIndex &parent, int begin, int end) | - | ||||||||||||||||||||||||
| 1327 | { | - | ||||||||||||||||||||||||
| 1328 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1329 | if (parent == d->m_adaptorModel.rootIndex
| 2-2276 | ||||||||||||||||||||||||
| 1330 | _q_itemsRemoved(begin, end - begin + 1); executed 2276 times by 7 tests: _q_itemsRemoved(begin, end - begin + 1);Executed by:
| 2276 | ||||||||||||||||||||||||
| 1331 | } executed 2278 times by 7 tests: end of blockExecuted by:
| 2278 | ||||||||||||||||||||||||
| 1332 | - | |||||||||||||||||||||||||
| 1333 | void QQmlDelegateModel::_q_rowsMoved( | - | ||||||||||||||||||||||||
| 1334 | const QModelIndex &sourceParent, int sourceStart, int sourceEnd, | - | ||||||||||||||||||||||||
| 1335 | const QModelIndex &destinationParent, int destinationRow) | - | ||||||||||||||||||||||||
| 1336 | { | - | ||||||||||||||||||||||||
| 1337 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1338 | const int count = sourceEnd - sourceStart + 1; | - | ||||||||||||||||||||||||
| 1339 | if (destinationParent == d->m_adaptorModel.rootIndex
| 2-1082 | ||||||||||||||||||||||||
| 1340 | _q_itemsMoved(sourceStart, sourceStart > destinationRow ? destinationRow : destinationRow - count, count); | - | ||||||||||||||||||||||||
| 1341 | } executed 1080 times by 5 tests: else if (sourceParent == d->m_adaptorModel.rootIndexend of blockExecuted by:
| 2-1080 | ||||||||||||||||||||||||
| 1342 | _q_itemsRemoved(sourceStart, count); | - | ||||||||||||||||||||||||
| 1343 | } executed 2 times by 1 test: else if (destinationParent == d->m_adaptorModel.rootIndexend of blockExecuted by:
| 2-4 | ||||||||||||||||||||||||
| 1344 | _q_itemsInserted(destinationRow, count); | - | ||||||||||||||||||||||||
| 1345 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 1346 | } executed 1088 times by 5 tests: end of blockExecuted by:
| 1088 | ||||||||||||||||||||||||
| 1347 | - | |||||||||||||||||||||||||
| 1348 | void QQmlDelegateModel::_q_dataChanged(const QModelIndex &begin, const QModelIndex &end, const QVector<int> &roles) | - | ||||||||||||||||||||||||
| 1349 | { | - | ||||||||||||||||||||||||
| 1350 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1351 | if (begin.parent() != d->m_adaptorModel.rootIndex
| 0-316 | ||||||||||||||||||||||||
| 1352 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1353 | - | |||||||||||||||||||||||||
| 1354 | int rowCount = end.row() - begin.row() + 1; | - | ||||||||||||||||||||||||
| 1355 | - | |||||||||||||||||||||||||
| 1356 | for (int col = begin.column(); col <= end.column()
| 316 | ||||||||||||||||||||||||
| 1357 | int startIndex = d->m_adaptorModel.indexAt(begin.row(), col); | - | ||||||||||||||||||||||||
| 1358 | _q_itemsChanged(startIndex, rowCount, roles); | - | ||||||||||||||||||||||||
| 1359 | } executed 316 times by 5 tests: end of blockExecuted by:
| 316 | ||||||||||||||||||||||||
| 1360 | } executed 316 times by 5 tests: end of blockExecuted by:
| 316 | ||||||||||||||||||||||||
| 1361 | - | |||||||||||||||||||||||||
| 1362 | bool QQmlDelegateModel::isDescendantOf(const QPersistentModelIndex& desc, const QList< QPersistentModelIndex >& parents) const | - | ||||||||||||||||||||||||
| 1363 | { | - | ||||||||||||||||||||||||
| 1364 | for (int i = 0, c = parents.count(); i < c
| 0 | ||||||||||||||||||||||||
| 1365 | for (QPersistentModelIndex parent = desc; parent.isValid()
| 0 | ||||||||||||||||||||||||
| 1366 | if (parent == parents[i]
| 0 | ||||||||||||||||||||||||
| 1367 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||||||||
| 1368 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1369 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1370 | - | |||||||||||||||||||||||||
| 1371 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1372 | } | - | ||||||||||||||||||||||||
| 1373 | - | |||||||||||||||||||||||||
| 1374 | void QQmlDelegateModel::_q_layoutChanged(const QList<QPersistentModelIndex> &parents, QAbstractItemModel::LayoutChangeHint hint) | - | ||||||||||||||||||||||||
| 1375 | { | - | ||||||||||||||||||||||||
| 1376 | QQmlDelegateModelPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 1377 | if (!d->m_complete
| 0-186 | ||||||||||||||||||||||||
| 1378 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1379 | - | |||||||||||||||||||||||||
| 1380 | if (hint == QAbstractItemModel::VerticalSortHint
| 4-182 | ||||||||||||||||||||||||
| 1381 | if (!parents.isEmpty()
| 0-166 | ||||||||||||||||||||||||
| 1382 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1383 | } | - | ||||||||||||||||||||||||
| 1384 | - | |||||||||||||||||||||||||
| 1385 | - | |||||||||||||||||||||||||
| 1386 | _q_itemsChanged(0, d->m_count, QVector<int>()); | - | ||||||||||||||||||||||||
| 1387 | - | |||||||||||||||||||||||||
| 1388 | } executed 182 times by 2 tests: else if (hint == QAbstractItemModel::HorizontalSortHintend of blockExecuted by:
| 0-182 | ||||||||||||||||||||||||
| 1389 | - | |||||||||||||||||||||||||
| 1390 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 1391 | - | |||||||||||||||||||||||||
| 1392 | _q_modelReset(); | - | ||||||||||||||||||||||||
| 1393 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 1394 | } | - | ||||||||||||||||||||||||
| 1395 | - | |||||||||||||||||||||||||
| 1396 | QQmlDelegateModelAttached *QQmlDelegateModel::qmlAttachedProperties(QObject *obj) | - | ||||||||||||||||||||||||
| 1397 | { | - | ||||||||||||||||||||||||
| 1398 | if (QQmlDelegateModelItem *cacheItem = QQmlDelegateModelItem::dataForObject(obj)
| 2-2292 | ||||||||||||||||||||||||
| 1399 | if (cacheItem->object == obj
| 2-2290 | ||||||||||||||||||||||||
| 1400 | cacheItem->attached = new QQmlDelegateModelAttached(cacheItem, obj); | - | ||||||||||||||||||||||||
| 1401 | return executed 2290 times by 3 tests: cacheItem->attached;return cacheItem->attached;Executed by:
executed 2290 times by 3 tests: return cacheItem->attached;Executed by:
| 2290 | ||||||||||||||||||||||||
| 1402 | } | - | ||||||||||||||||||||||||
| 1403 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 1404 | return executed 4 times by 1 test: new QQmlDelegateModelAttached(obj);return new QQmlDelegateModelAttached(obj);Executed by:
executed 4 times by 1 test: return new QQmlDelegateModelAttached(obj);Executed by:
| 4 | ||||||||||||||||||||||||
| 1405 | } | - | ||||||||||||||||||||||||
| 1406 | - | |||||||||||||||||||||||||
| 1407 | bool QQmlDelegateModelPrivate::insert(Compositor::insert_iterator &before, const QV4::Value &object, int groups) | - | ||||||||||||||||||||||||
| 1408 | { | - | ||||||||||||||||||||||||
| 1409 | if (!m_context
| 0-416 | ||||||||||||||||||||||||
| 1410 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1411 | - | |||||||||||||||||||||||||
| 1412 | QQmlDelegateModelItem *cacheItem = m_adaptorModel.createItem(m_cacheMetaType, -1); | - | ||||||||||||||||||||||||
| 1413 | if (!cacheItem
| 12-404 | ||||||||||||||||||||||||
| 1414 | return executed 12 times by 1 test: false;return false;Executed by:
executed 12 times by 1 test: return false;Executed by:
| 12 | ||||||||||||||||||||||||
| 1415 | if (!object.isObject()
| 0-404 | ||||||||||||||||||||||||
| 1416 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1417 | - | |||||||||||||||||||||||||
| 1418 | QV4::ExecutionEngine *v4 = object.as<QV4::Object>()->engine(); | - | ||||||||||||||||||||||||
| 1419 | QV4::Scope scope(v4); | - | ||||||||||||||||||||||||
| 1420 | QV4::ScopedObject o(scope, object); | - | ||||||||||||||||||||||||
| 1421 | if (!o
| 0-404 | ||||||||||||||||||||||||
| 1422 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1423 | - | |||||||||||||||||||||||||
| 1424 | QV4::ObjectIterator it(scope, o, QV4::ObjectIterator::EnumerableOnly|QV4::ObjectIterator::WithProtoChain); | - | ||||||||||||||||||||||||
| 1425 | QV4::ScopedValue propertyName(scope); | - | ||||||||||||||||||||||||
| 1426 | QV4::ScopedValue v(scope); | - | ||||||||||||||||||||||||
| 1427 | while (1) { | - | ||||||||||||||||||||||||
| 1428 | propertyName = it.nextPropertyNameAsString(v); | - | ||||||||||||||||||||||||
| 1429 | if (propertyName->isNull()
| 404 | ||||||||||||||||||||||||
| 1430 | break; executed 404 times by 1 test: break;Executed by:
| 404 | ||||||||||||||||||||||||
| 1431 | cacheItem->setValue(propertyName->toQStringNoThrow(), scope.engine->toVariant(v, QVariant::Invalid)); | - | ||||||||||||||||||||||||
| 1432 | } executed 404 times by 1 test: end of blockExecuted by:
| 404 | ||||||||||||||||||||||||
| 1433 | - | |||||||||||||||||||||||||
| 1434 | cacheItem->groups = groups | Compositor::UnresolvedFlag | Compositor::CacheFlag; | - | ||||||||||||||||||||||||
| 1435 | - | |||||||||||||||||||||||||
| 1436 | - | |||||||||||||||||||||||||
| 1437 | itemsInserted(QVector<Compositor::Insert>(1, Compositor::Insert(before, 1, cacheItem->groups & ~Compositor::CacheFlag))); | - | ||||||||||||||||||||||||
| 1438 | - | |||||||||||||||||||||||||
| 1439 | before = m_compositor.insert(before, nullptr, 0, 1, cacheItem->groups); | - | ||||||||||||||||||||||||
| 1440 | m_cache.insert(before.cacheIndex, cacheItem); | - | ||||||||||||||||||||||||
| 1441 | - | |||||||||||||||||||||||||
| 1442 | return executed 404 times by 1 test: true;return true;Executed by:
executed 404 times by 1 test: return true;Executed by:
| 404 | ||||||||||||||||||||||||
| 1443 | } | - | ||||||||||||||||||||||||
| 1444 | - | |||||||||||||||||||||||||
| 1445 | - | |||||||||||||||||||||||||
| 1446 | - | |||||||||||||||||||||||||
| 1447 | QQmlDelegateModelItemMetaType::QQmlDelegateModelItemMetaType( | - | ||||||||||||||||||||||||
| 1448 | QV4::ExecutionEngine *engine, QQmlDelegateModel *model, const QStringList &groupNames) | - | ||||||||||||||||||||||||
| 1449 | : model(model) | - | ||||||||||||||||||||||||
| 1450 | , groupCount(groupNames.count() + 1) | - | ||||||||||||||||||||||||
| 1451 | , v4Engine(engine) | - | ||||||||||||||||||||||||
| 1452 | , metaObject(nullptr) | - | ||||||||||||||||||||||||
| 1453 | , groupNames(groupNames) | - | ||||||||||||||||||||||||
| 1454 | { | - | ||||||||||||||||||||||||
| 1455 | } executed 5622 times by 27 tests: end of blockExecuted by:
| 5622 | ||||||||||||||||||||||||
| 1456 | - | |||||||||||||||||||||||||
| 1457 | QQmlDelegateModelItemMetaType::~QQmlDelegateModelItemMetaType() | - | ||||||||||||||||||||||||
| 1458 | { | - | ||||||||||||||||||||||||
| 1459 | if (metaObject
| 438-5111 | ||||||||||||||||||||||||
| 1460 | metaObject->release(); executed 438 times by 3 tests: metaObject->release();Executed by:
| 438 | ||||||||||||||||||||||||
| 1461 | } executed 5549 times by 25 tests: end of blockExecuted by:
| 5549 | ||||||||||||||||||||||||
| 1462 | - | |||||||||||||||||||||||||
| 1463 | void QQmlDelegateModelItemMetaType::initializeMetaObject() | - | ||||||||||||||||||||||||
| 1464 | { | - | ||||||||||||||||||||||||
| 1465 | QMetaObjectBuilder builder; | - | ||||||||||||||||||||||||
| 1466 | builder.setFlags(QMetaObjectBuilder::DynamicMetaObject); | - | ||||||||||||||||||||||||
| 1467 | builder.setClassName(QQmlDelegateModelAttached::staticMetaObject.className()); | - | ||||||||||||||||||||||||
| 1468 | builder.setSuperClass(&QQmlDelegateModelAttached::staticMetaObject); | - | ||||||||||||||||||||||||
| 1469 | - | |||||||||||||||||||||||||
| 1470 | int notifierId = 0; | - | ||||||||||||||||||||||||
| 1471 | for (int i = 0; i < groupNames.count()
| 438-1730 | ||||||||||||||||||||||||
| 1472 | QString propertyName = QLatin1String("in") + groupNames.at(i); | - | ||||||||||||||||||||||||
| 1473 | propertyName.replace(2, 1, propertyName.at(2).toUpper()); | - | ||||||||||||||||||||||||
| 1474 | builder.addSignal("__" + propertyName.toUtf8() + "Changed()"); | - | ||||||||||||||||||||||||
| 1475 | QMetaPropertyBuilder propertyBuilder = builder.addProperty( | - | ||||||||||||||||||||||||
| 1476 | propertyName.toUtf8(), "bool", notifierId); | - | ||||||||||||||||||||||||
| 1477 | propertyBuilder.setWritable(true); | - | ||||||||||||||||||||||||
| 1478 | } executed 1730 times by 3 tests: end of blockExecuted by:
| 1730 | ||||||||||||||||||||||||
| 1479 | for (int i = 0; i < groupNames.count()
| 438-1730 | ||||||||||||||||||||||||
| 1480 | const QString propertyName = groupNames.at(i) + QLatin1String("Index"); | - | ||||||||||||||||||||||||
| 1481 | builder.addSignal("__" + propertyName.toUtf8() + "Changed()"); | - | ||||||||||||||||||||||||
| 1482 | QMetaPropertyBuilder propertyBuilder = builder.addProperty( | - | ||||||||||||||||||||||||
| 1483 | propertyName.toUtf8(), "int", notifierId); | - | ||||||||||||||||||||||||
| 1484 | propertyBuilder.setWritable(true); | - | ||||||||||||||||||||||||
| 1485 | } executed 1730 times by 3 tests: end of blockExecuted by:
| 1730 | ||||||||||||||||||||||||
| 1486 | - | |||||||||||||||||||||||||
| 1487 | metaObject = new QQmlDelegateModelAttachedMetaObject(this, builder.toMetaObject()); | - | ||||||||||||||||||||||||
| 1488 | } executed 438 times by 3 tests: end of blockExecuted by:
| 438 | ||||||||||||||||||||||||
| 1489 | - | |||||||||||||||||||||||||
| 1490 | void QQmlDelegateModelItemMetaType::initializePrototype() | - | ||||||||||||||||||||||||
| 1491 | { | - | ||||||||||||||||||||||||
| 1492 | QV4::Scope scope(v4Engine); | - | ||||||||||||||||||||||||
| 1493 | - | |||||||||||||||||||||||||
| 1494 | QV4::ScopedObject proto(scope, v4Engine->newObject()); | - | ||||||||||||||||||||||||
| 1495 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "model")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "model" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 420 times by 2 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 420 times by 2 tests: }()), QQmlDelegateModelItem::get_model, nullptr);return qstring_literal_temp;Executed by:
| 420 | ||||||||||||||||||||||||
| 1496 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "groups")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "groups" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 420 times by 2 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 420 times by 2 tests: }()), QQmlDelegateModelItem::get_groups, QQmlDelegateModelItem::set_groups);return qstring_literal_temp;Executed by:
| 420 | ||||||||||||||||||||||||
| 1497 | QV4::ScopedString s(scope); | - | ||||||||||||||||||||||||
| 1498 | QV4::ScopedProperty p(scope); | - | ||||||||||||||||||||||||
| 1499 | - | |||||||||||||||||||||||||
| 1500 | s = v4Engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "isUnresolved")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "isUnresolved" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 420 times by 2 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 420 times by 2 tests: }()));return qstring_literal_temp;Executed by:
| 420 | ||||||||||||||||||||||||
| 1501 | QV4::ScopedFunctionObject f(scope); | - | ||||||||||||||||||||||||
| 1502 | QV4::ExecutionContext *global = scope.engine->rootContext(); | - | ||||||||||||||||||||||||
| 1503 | p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, 30, QQmlDelegateModelItem::get_member))); | - | ||||||||||||||||||||||||
| 1504 | p->setSetter(nullptr); | - | ||||||||||||||||||||||||
| 1505 | proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); | - | ||||||||||||||||||||||||
| 1506 | - | |||||||||||||||||||||||||
| 1507 | s = v4Engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "inItems")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "inItems" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 420 times by 2 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 420 times by 2 tests: }()));return qstring_literal_temp;Executed by:
| 420 | ||||||||||||||||||||||||
| 1508 | p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, QQmlListCompositor::Default, QQmlDelegateModelItem::get_member))); | - | ||||||||||||||||||||||||
| 1509 | p->setSetter((f = QV4::DelegateModelGroupFunction::create(global, QQmlListCompositor::Default, QQmlDelegateModelItem::set_member))); | - | ||||||||||||||||||||||||
| 1510 | proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); | - | ||||||||||||||||||||||||
| 1511 | - | |||||||||||||||||||||||||
| 1512 | s = v4Engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "inPersistedItems")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "inPersistedItems" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 420 times by 2 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 420 times by 2 tests: }()));return qstring_literal_temp;Executed by:
| 420 | ||||||||||||||||||||||||
| 1513 | p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, QQmlListCompositor::Persisted, QQmlDelegateModelItem::get_member))); | - | ||||||||||||||||||||||||
| 1514 | p->setSetter((f = QV4::DelegateModelGroupFunction::create(global, QQmlListCompositor::Persisted, QQmlDelegateModelItem::set_member))); | - | ||||||||||||||||||||||||
| 1515 | proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); | - | ||||||||||||||||||||||||
| 1516 | - | |||||||||||||||||||||||||
| 1517 | s = v4Engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "itemsIndex")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "itemsIndex" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 420 times by 2 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 420 times by 2 tests: }()));return qstring_literal_temp;Executed by:
| 420 | ||||||||||||||||||||||||
| 1518 | p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, QQmlListCompositor::Default, QQmlDelegateModelItem::get_index))); | - | ||||||||||||||||||||||||
| 1519 | proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); | - | ||||||||||||||||||||||||
| 1520 | - | |||||||||||||||||||||||||
| 1521 | s = v4Engine->newString(([]() noexcept -> QString { enum { Size = sizeof(u"" "persistedItemsIndex")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "persistedItemsIndex" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 420 times by 2 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 420 times by 2 tests: }()));return qstring_literal_temp;Executed by:
| 420 | ||||||||||||||||||||||||
| 1522 | p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, QQmlListCompositor::Persisted, QQmlDelegateModelItem::get_index))); | - | ||||||||||||||||||||||||
| 1523 | p->setSetter(nullptr); | - | ||||||||||||||||||||||||
| 1524 | proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); | - | ||||||||||||||||||||||||
| 1525 | - | |||||||||||||||||||||||||
| 1526 | for (int i = 2; i < groupNames.count()
| 420-830 | ||||||||||||||||||||||||
| 1527 | QString propertyName = QLatin1String("in") + groupNames.at(i); | - | ||||||||||||||||||||||||
| 1528 | propertyName.replace(2, 1, propertyName.at(2).toUpper()); | - | ||||||||||||||||||||||||
| 1529 | s = v4Engine->newString(propertyName); | - | ||||||||||||||||||||||||
| 1530 | p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, i + 1, QQmlDelegateModelItem::get_member))); | - | ||||||||||||||||||||||||
| 1531 | p->setSetter((f = QV4::DelegateModelGroupFunction::create(global, i + 1, QQmlDelegateModelItem::set_member))); | - | ||||||||||||||||||||||||
| 1532 | proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); | - | ||||||||||||||||||||||||
| 1533 | } executed 830 times by 2 tests: end of blockExecuted by:
| 830 | ||||||||||||||||||||||||
| 1534 | for (int i = 2; i < groupNames.count()
| 420-830 | ||||||||||||||||||||||||
| 1535 | const QString propertyName = groupNames.at(i) + QLatin1String("Index"); | - | ||||||||||||||||||||||||
| 1536 | s = v4Engine->newString(propertyName); | - | ||||||||||||||||||||||||
| 1537 | p->setGetter((f = QV4::DelegateModelGroupFunction::create(global, i + 1, QQmlDelegateModelItem::get_index))); | - | ||||||||||||||||||||||||
| 1538 | p->setSetter(nullptr); | - | ||||||||||||||||||||||||
| 1539 | proto->insertMember(s, p, QV4::Attr_Accessor|QV4::Attr_NotConfigurable|QV4::Attr_NotEnumerable); | - | ||||||||||||||||||||||||
| 1540 | } executed 830 times by 2 tests: end of blockExecuted by:
| 830 | ||||||||||||||||||||||||
| 1541 | modelItemProto.set(v4Engine, proto); | - | ||||||||||||||||||||||||
| 1542 | } executed 420 times by 2 tests: end of blockExecuted by:
| 420 | ||||||||||||||||||||||||
| 1543 | - | |||||||||||||||||||||||||
| 1544 | int QQmlDelegateModelItemMetaType::parseGroups(const QStringList &groups) const | - | ||||||||||||||||||||||||
| 1545 | { | - | ||||||||||||||||||||||||
| 1546 | int groupFlags = 0; | - | ||||||||||||||||||||||||
| 1547 | for (const QString &groupName : groups) { | - | ||||||||||||||||||||||||
| 1548 | int index = groupNames.indexOf(groupName); | - | ||||||||||||||||||||||||
| 1549 | if (index != -1
| 0-2 | ||||||||||||||||||||||||
| 1550 | groupFlags |= 2 << index; executed 2 times by 1 test: groupFlags |= 2 << index;Executed by:
| 2 | ||||||||||||||||||||||||
| 1551 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 1552 | return executed 2 times by 1 test: groupFlags;return groupFlags;Executed by:
executed 2 times by 1 test: return groupFlags;Executed by:
| 2 | ||||||||||||||||||||||||
| 1553 | } | - | ||||||||||||||||||||||||
| 1554 | - | |||||||||||||||||||||||||
| 1555 | int QQmlDelegateModelItemMetaType::parseGroups(const QV4::Value &groups) const | - | ||||||||||||||||||||||||
| 1556 | { | - | ||||||||||||||||||||||||
| 1557 | int groupFlags = 0; | - | ||||||||||||||||||||||||
| 1558 | QV4::Scope scope(v4Engine); | - | ||||||||||||||||||||||||
| 1559 | - | |||||||||||||||||||||||||
| 1560 | QV4::ScopedString s(scope, groups); | - | ||||||||||||||||||||||||
| 1561 | if (s
| 32-126 | ||||||||||||||||||||||||
| 1562 | const QString groupName = s->toQString(); | - | ||||||||||||||||||||||||
| 1563 | int index = groupNames.indexOf(groupName); | - | ||||||||||||||||||||||||
| 1564 | if (index != -1
| 0-126 | ||||||||||||||||||||||||
| 1565 | groupFlags |= 2 << index; executed 126 times by 2 tests: groupFlags |= 2 << index;Executed by:
| 126 | ||||||||||||||||||||||||
| 1566 | return executed 126 times by 2 tests: groupFlags;return groupFlags;Executed by:
executed 126 times by 2 tests: return groupFlags;Executed by:
| 126 | ||||||||||||||||||||||||
| 1567 | } | - | ||||||||||||||||||||||||
| 1568 | - | |||||||||||||||||||||||||
| 1569 | QV4::ScopedArrayObject array(scope, groups); | - | ||||||||||||||||||||||||
| 1570 | if (array
| 0-32 | ||||||||||||||||||||||||
| 1571 | QV4::ScopedValue v(scope); | - | ||||||||||||||||||||||||
| 1572 | uint arrayLength = array->getLength(); | - | ||||||||||||||||||||||||
| 1573 | for (uint i = 0; i < arrayLength
| 32-64 | ||||||||||||||||||||||||
| 1574 | v = array->get(i); | - | ||||||||||||||||||||||||
| 1575 | const QString groupName = v->toQString(); | - | ||||||||||||||||||||||||
| 1576 | int index = groupNames.indexOf(groupName); | - | ||||||||||||||||||||||||
| 1577 | if (index != -1
| 8-56 | ||||||||||||||||||||||||
| 1578 | groupFlags |= 2 << index; executed 56 times by 1 test: groupFlags |= 2 << index;Executed by:
| 56 | ||||||||||||||||||||||||
| 1579 | } executed 64 times by 1 test: end of blockExecuted by:
| 64 | ||||||||||||||||||||||||
| 1580 | } executed 32 times by 1 test: end of blockExecuted by:
| 32 | ||||||||||||||||||||||||
| 1581 | return executed 32 times by 1 test: groupFlags;return groupFlags;Executed by:
executed 32 times by 1 test: return groupFlags;Executed by:
| 32 | ||||||||||||||||||||||||
| 1582 | } | - | ||||||||||||||||||||||||
| 1583 | - | |||||||||||||||||||||||||
| 1584 | QV4::ReturnedValue QQmlDelegateModelItem::get_model(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||
| 1585 | { | - | ||||||||||||||||||||||||
| 1586 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||
| 1587 | QV4::Scoped<QQmlDelegateModelItemObject> o(scope, thisObject->as<QQmlDelegateModelItemObject>()); | - | ||||||||||||||||||||||||
| 1588 | if (!o
| 0-5276 | ||||||||||||||||||||||||
| 1589 | return never executed: b->engine()->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Not a valid VisualData object")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Not a valid VisualData object" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn b->engine()->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Not a valid VisualData object")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Not a valid VisualData object" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()));return qstring_literal_temp;never executed: return b->engine()->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Not a valid VisualData object")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Not a valid VisualData object" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())); | 0 | ||||||||||||||||||||||||
| 1590 | if (!o->d()->item->metaType->model
| 0-5276 | ||||||||||||||||||||||||
| 1591 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||
| 1592 | - | |||||||||||||||||||||||||
| 1593 | return executed 5276 times by 2 tests: o->d()->item->get();return o->d()->item->get();Executed by:
executed 5276 times by 2 tests: return o->d()->item->get();Executed by:
| 5276 | ||||||||||||||||||||||||
| 1594 | } | - | ||||||||||||||||||||||||
| 1595 | - | |||||||||||||||||||||||||
| 1596 | QV4::ReturnedValue QQmlDelegateModelItem::get_groups(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) | - | ||||||||||||||||||||||||
| 1597 | { | - | ||||||||||||||||||||||||
| 1598 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||
| 1599 | QV4::Scoped<QQmlDelegateModelItemObject> o(scope, thisObject->as<QQmlDelegateModelItemObject>()); | - | ||||||||||||||||||||||||
| 1600 | if (!o
| 0-1176 | ||||||||||||||||||||||||
| 1601 | return never executed: scope.engine->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Not a valid VisualData object")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Not a valid VisualData object" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn scope.engine->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Not a valid VisualData object")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Not a valid VisualData object" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()));return qstring_literal_temp;never executed: return scope.engine->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Not a valid VisualData object")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Not a valid VisualData object" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())); | 0 | ||||||||||||||||||||||||
| 1602 | - | |||||||||||||||||||||||||
| 1603 | QStringList groups; | - | ||||||||||||||||||||||||
| 1604 | for (int i = 1; i < o->d()->item->metaType->groupCount
| 1176-4704 | ||||||||||||||||||||||||
| 1605 | if (o->d()->item->groups & (1 << i)
| 2124-2580 | ||||||||||||||||||||||||
| 1606 | groups.append(o->d()->item->metaType->groupNames.at(i - 1)); executed 2580 times by 1 test: groups.append(o->d()->item->metaType->groupNames.at(i - 1));Executed by:
| 2580 | ||||||||||||||||||||||||
| 1607 | } executed 4704 times by 1 test: end of blockExecuted by:
| 4704 | ||||||||||||||||||||||||
| 1608 | - | |||||||||||||||||||||||||
| 1609 | return executed 1176 times by 1 test: scope.engine->fromVariant(groups);return scope.engine->fromVariant(groups);Executed by:
executed 1176 times by 1 test: return scope.engine->fromVariant(groups);Executed by:
| 1176 | ||||||||||||||||||||||||
| 1610 | } | - | ||||||||||||||||||||||||
| 1611 | - | |||||||||||||||||||||||||
| 1612 | QV4::ReturnedValue QQmlDelegateModelItem::set_groups(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *argv, int argc) | - | ||||||||||||||||||||||||
| 1613 | { | - | ||||||||||||||||||||||||
| 1614 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||
| 1615 | QV4::Scoped<QQmlDelegateModelItemObject> o(scope, thisObject->as<QQmlDelegateModelItemObject>()); | - | ||||||||||||||||||||||||
| 1616 | if (!o
| 0-20 | ||||||||||||||||||||||||
| 1617 | return never executed: scope.engine->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Not a valid VisualData object")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Not a valid VisualData object" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); returnreturn scope.engine->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Not a valid VisualData object")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Not a valid VisualData object" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }()));never executed: qstring_literal_temp;return qstring_literal_temp;never executed: }()));return qstring_literal_temp;never executed: return scope.engine->throwTypeError(([]() noexcept -> QString { enum { Size = sizeof(u"" "Not a valid VisualData object")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "Not a valid VisualData object" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return qstring_literal_temp; }())); | 0 | ||||||||||||||||||||||||
| 1618 | - | |||||||||||||||||||||||||
| 1619 | if (!argc
| 0-20 | ||||||||||||||||||||||||
| 1620 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 1621 | - | |||||||||||||||||||||||||
| 1622 | if (!o->d()->item->metaType->model
| 0-20 | ||||||||||||||||||||||||
| 1623 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||
| 1624 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(o->d()->item->metaType->model); | - | ||||||||||||||||||||||||
| 1625 | - | |||||||||||||||||||||||||
| 1626 | const int groupFlags = model->m_cacheMetaType->parseGroups(argv[0]); | - | ||||||||||||||||||||||||
| 1627 | const int cacheIndex = model->m_cache.indexOf(o->d()->item); | - | ||||||||||||||||||||||||
| 1628 | Compositor::iterator it = model->m_compositor.find(Compositor::Cache, cacheIndex); | - | ||||||||||||||||||||||||
| 1629 | model->setGroups(it, 1, Compositor::Cache, groupFlags); | - | ||||||||||||||||||||||||
| 1630 | return executed 20 times by 2 tests: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 20 times by 2 tests: return QV4::Encode::undefined();Executed by:
| 20 | ||||||||||||||||||||||||
| 1631 | } | - | ||||||||||||||||||||||||
| 1632 | - | |||||||||||||||||||||||||
| 1633 | QV4::ReturnedValue QQmlDelegateModelItem::get_member(QQmlDelegateModelItem *thisItem, uint flag, const QV4::Value &) | - | ||||||||||||||||||||||||
| 1634 | { | - | ||||||||||||||||||||||||
| 1635 | return executed 11120 times by 1 test: QV4::Encode(bool(thisItem->groups & (1 << flag)));return QV4::Encode(bool(thisItem->groups & (1 << flag)));Executed by:
executed 11120 times by 1 test: return QV4::Encode(bool(thisItem->groups & (1 << flag)));Executed by:
| 11120 | ||||||||||||||||||||||||
| 1636 | } | - | ||||||||||||||||||||||||
| 1637 | - | |||||||||||||||||||||||||
| 1638 | QV4::ReturnedValue QQmlDelegateModelItem::set_member(QQmlDelegateModelItem *cacheItem, uint flag, const QV4::Value &arg) | - | ||||||||||||||||||||||||
| 1639 | { | - | ||||||||||||||||||||||||
| 1640 | if (!cacheItem->metaType->model
| 0-16 | ||||||||||||||||||||||||
| 1641 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||
| 1642 | - | |||||||||||||||||||||||||
| 1643 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(cacheItem->metaType->model); | - | ||||||||||||||||||||||||
| 1644 | - | |||||||||||||||||||||||||
| 1645 | bool member = arg.toBoolean(); | - | ||||||||||||||||||||||||
| 1646 | uint groupFlag = (1 << flag); | - | ||||||||||||||||||||||||
| 1647 | if (member == ((cacheItem->groups & groupFlag) != 0)
| 0-16 | ||||||||||||||||||||||||
| 1648 | return never executed: QV4::Encode::undefined();return QV4::Encode::undefined();never executed: return QV4::Encode::undefined(); | 0 | ||||||||||||||||||||||||
| 1649 | - | |||||||||||||||||||||||||
| 1650 | const int cacheIndex = model->m_cache.indexOf(cacheItem); | - | ||||||||||||||||||||||||
| 1651 | Compositor::iterator it = model->m_compositor.find(Compositor::Cache, cacheIndex); | - | ||||||||||||||||||||||||
| 1652 | if (member
| 2-14 | ||||||||||||||||||||||||
| 1653 | model->addGroups(it, 1, Compositor::Cache, groupFlag); executed 2 times by 1 test: model->addGroups(it, 1, Compositor::Cache, groupFlag);Executed by:
| 2 | ||||||||||||||||||||||||
| 1654 | else | - | ||||||||||||||||||||||||
| 1655 | model->removeGroups(it, 1, Compositor::Cache, groupFlag); executed 14 times by 1 test: model->removeGroups(it, 1, Compositor::Cache, groupFlag);Executed by:
| 14 | ||||||||||||||||||||||||
| 1656 | return executed 16 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 16 times by 1 test: return QV4::Encode::undefined();Executed by:
| 16 | ||||||||||||||||||||||||
| 1657 | } | - | ||||||||||||||||||||||||
| 1658 | - | |||||||||||||||||||||||||
| 1659 | QV4::ReturnedValue QQmlDelegateModelItem::get_index(QQmlDelegateModelItem *thisItem, uint flag, const QV4::Value &) | - | ||||||||||||||||||||||||
| 1660 | { | - | ||||||||||||||||||||||||
| 1661 | return executed 9146 times by 2 tests: QV4::Encode((int)thisItem->groupIndex(Compositor::Group(flag)));return QV4::Encode((int)thisItem->groupIndex(Compositor::Group(flag)));Executed by:
executed 9146 times by 2 tests: return QV4::Encode((int)thisItem->groupIndex(Compositor::Group(flag)));Executed by:
| 9146 | ||||||||||||||||||||||||
| 1662 | } | - | ||||||||||||||||||||||||
| 1663 | - | |||||||||||||||||||||||||
| 1664 | - | |||||||||||||||||||||||||
| 1665 | - | |||||||||||||||||||||||||
| 1666 | - | |||||||||||||||||||||||||
| 1667 | const QV4::VTable QQmlDelegateModelItemObject::static_vtbl = { (std::is_same<QQmlDelegateModelItemObject::SuperClass, Object>::value) ? nullptr : &QQmlDelegateModelItemObject::SuperClass::static_vtbl, (sizeof(QQmlDelegateModelItemObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(QQmlDelegateModelItemObject::Data) + (QQmlDelegateModelItemObject::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(QQmlDelegateModelItemObject::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), QQmlDelegateModelItemObject::IsExecutionContext, QQmlDelegateModelItemObject::IsString, QQmlDelegateModelItemObject::IsObject, QQmlDelegateModelItemObject::IsFunctionObject, QQmlDelegateModelItemObject::IsErrorObject, QQmlDelegateModelItemObject::IsArrayData, QQmlDelegateModelItemObject::IsStringOrSymbol, QQmlDelegateModelItemObject::MyType, { 0, 0, 0, 0 }, "QQmlDelegateModelItemObject", QQmlDelegateModelItemObject::virtualDestroy, QQmlDelegateModelItemObject::Data::markObjects, QQmlDelegateModelItemObject::virtualIsEqualTo, QQmlDelegateModelItemObject::virtualGet, QQmlDelegateModelItemObject::virtualPut, QQmlDelegateModelItemObject::virtualDeleteProperty, QQmlDelegateModelItemObject::virtualHasProperty, QQmlDelegateModelItemObject::virtualGetOwnProperty, QQmlDelegateModelItemObject::virtualDefineOwnProperty, QQmlDelegateModelItemObject::virtualIsExtensible, QQmlDelegateModelItemObject::virtualPreventExtensions, QQmlDelegateModelItemObject::virtualGetPrototypeOf, QQmlDelegateModelItemObject::virtualSetPrototypeOf, QQmlDelegateModelItemObject::virtualGetLength, QQmlDelegateModelItemObject::virtualAdvanceIterator, QQmlDelegateModelItemObject::virtualInstanceOf, QQmlDelegateModelItemObject::virtualCall, QQmlDelegateModelItemObject::virtualCallAsConstructor, }; | - | ||||||||||||||||||||||||
| 1668 | - | |||||||||||||||||||||||||
| 1669 | void QV4::Heap::QQmlDelegateModelItemObject::destroy() | - | ||||||||||||||||||||||||
| 1670 | { | - | ||||||||||||||||||||||||
| 1671 | item->Dispose(); | - | ||||||||||||||||||||||||
| 1672 | Object::destroy(); | - | ||||||||||||||||||||||||
| 1673 | } executed 31966 times by 2 tests: end of blockExecuted by:
| 31966 | ||||||||||||||||||||||||
| 1674 | - | |||||||||||||||||||||||||
| 1675 | - | |||||||||||||||||||||||||
| 1676 | QQmlDelegateModelItem::QQmlDelegateModelItem( | - | ||||||||||||||||||||||||
| 1677 | QQmlDelegateModelItemMetaType *metaType, int modelIndex) | - | ||||||||||||||||||||||||
| 1678 | : v4(metaType->v4Engine) | - | ||||||||||||||||||||||||
| 1679 | , metaType(metaType) | - | ||||||||||||||||||||||||
| 1680 | , contextData(nullptr) | - | ||||||||||||||||||||||||
| 1681 | , object(nullptr) | - | ||||||||||||||||||||||||
| 1682 | , attached(nullptr) | - | ||||||||||||||||||||||||
| 1683 | , incubationTask(nullptr) | - | ||||||||||||||||||||||||
| 1684 | , objectRef(0) | - | ||||||||||||||||||||||||
| 1685 | , scriptRef(0) | - | ||||||||||||||||||||||||
| 1686 | , groups(0) | - | ||||||||||||||||||||||||
| 1687 | , index(modelIndex) | - | ||||||||||||||||||||||||
| 1688 | , row(QQmlDelegateModelPrivate::get(metaType->model)->m_adaptorModel.rowAt(modelIndex)) | - | ||||||||||||||||||||||||
| 1689 | , column(QQmlDelegateModelPrivate::get(metaType->model)->m_adaptorModel.columnAt(modelIndex)) | - | ||||||||||||||||||||||||
| 1690 | { | - | ||||||||||||||||||||||||
| 1691 | metaType->addref(); | - | ||||||||||||||||||||||||
| 1692 | } executed 88443 times by 25 tests: end of blockExecuted by:
| 88443 | ||||||||||||||||||||||||
| 1693 | - | |||||||||||||||||||||||||
| 1694 | QQmlDelegateModelItem::~QQmlDelegateModelItem() | - | ||||||||||||||||||||||||
| 1695 | { | - | ||||||||||||||||||||||||
| 1696 | ((scriptRef == 0) ? static_cast<void>(0) : qt_assert("scriptRef == 0", __FILE__, 1982)); | - | ||||||||||||||||||||||||
| 1697 | ((objectRef == 0) ? static_cast<void>(0) : qt_assert("objectRef == 0", __FILE__, 1983)); | - | ||||||||||||||||||||||||
| 1698 | ((!object) ? static_cast<void>(0) : qt_assert("!object", __FILE__, 1984)); | - | ||||||||||||||||||||||||
| 1699 | - | |||||||||||||||||||||||||
| 1700 | if (incubationTask
| 29-88261 | ||||||||||||||||||||||||
| 1701 | if (metaType->model
| 0-29 | ||||||||||||||||||||||||
| 1702 | QQmlDelegateModelPrivate::get(metaType->model)->releaseIncubator(incubationTask); never executed: QQmlDelegateModelPrivate::get(metaType->model)->releaseIncubator(incubationTask); | 0 | ||||||||||||||||||||||||
| 1703 | else | - | ||||||||||||||||||||||||
| 1704 | delete incubationTask; executed 29 times by 2 tests: delete incubationTask;Executed by:
| 29 | ||||||||||||||||||||||||
| 1705 | } | - | ||||||||||||||||||||||||
| 1706 | - | |||||||||||||||||||||||||
| 1707 | metaType->release(); | - | ||||||||||||||||||||||||
| 1708 | - | |||||||||||||||||||||||||
| 1709 | } executed 88290 times by 24 tests: end of blockExecuted by:
| 88290 | ||||||||||||||||||||||||
| 1710 | - | |||||||||||||||||||||||||
| 1711 | void QQmlDelegateModelItem::Dispose() | - | ||||||||||||||||||||||||
| 1712 | { | - | ||||||||||||||||||||||||
| 1713 | --scriptRef; | - | ||||||||||||||||||||||||
| 1714 | if (isReferenced()
| 24250-29974 | ||||||||||||||||||||||||
| 1715 | return; executed 29974 times by 2 tests: return;Executed by:
| 29974 | ||||||||||||||||||||||||
| 1716 | - | |||||||||||||||||||||||||
| 1717 | if (metaType->model
| 1986-22264 | ||||||||||||||||||||||||
| 1718 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(metaType->model); | - | ||||||||||||||||||||||||
| 1719 | model->removeCacheItem(this); | - | ||||||||||||||||||||||||
| 1720 | } executed 22264 times by 12 tests: end of blockExecuted by:
| 22264 | ||||||||||||||||||||||||
| 1721 | delete this; | - | ||||||||||||||||||||||||
| 1722 | } executed 24250 times by 13 tests: end of blockExecuted by:
| 24250 | ||||||||||||||||||||||||
| 1723 | - | |||||||||||||||||||||||||
| 1724 | void QQmlDelegateModelItem::setModelIndex(int idx) | - | ||||||||||||||||||||||||
| 1725 | { | - | ||||||||||||||||||||||||
| 1726 | if (idx == index
| 0-42185 | ||||||||||||||||||||||||
| 1727 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1728 | - | |||||||||||||||||||||||||
| 1729 | const int prevRow = row; | - | ||||||||||||||||||||||||
| 1730 | const int prevColumn = column; | - | ||||||||||||||||||||||||
| 1731 | const QQmlAdaptorModel &adaptorModel = QQmlDelegateModelPrivate::get(metaType->model)->m_adaptorModel; | - | ||||||||||||||||||||||||
| 1732 | - | |||||||||||||||||||||||||
| 1733 | index = idx; | - | ||||||||||||||||||||||||
| 1734 | row = adaptorModel.rowAt(idx); | - | ||||||||||||||||||||||||
| 1735 | column = adaptorModel.columnAt(idx); | - | ||||||||||||||||||||||||
| 1736 | - | |||||||||||||||||||||||||
| 1737 | modelIndexChanged(); | - | ||||||||||||||||||||||||
| 1738 | - | |||||||||||||||||||||||||
| 1739 | if (row != prevRow
| 18-42167 | ||||||||||||||||||||||||
| 1740 | rowChanged(); executed 42167 times by 7 tests: rowChanged();Executed by:
| 42167 | ||||||||||||||||||||||||
| 1741 | if (column != prevColumn
| 1193-40992 | ||||||||||||||||||||||||
| 1742 | columnChanged(); executed 1193 times by 5 tests: columnChanged();Executed by:
| 1193 | ||||||||||||||||||||||||
| 1743 | } executed 42185 times by 7 tests: end of blockExecuted by:
| 42185 | ||||||||||||||||||||||||
| 1744 | - | |||||||||||||||||||||||||
| 1745 | void QQmlDelegateModelItem::destroyObject() | - | ||||||||||||||||||||||||
| 1746 | { | - | ||||||||||||||||||||||||
| 1747 | ((object) ? static_cast<void>(0) : qt_assert("object", __FILE__, 2033)); | - | ||||||||||||||||||||||||
| 1748 | ((contextData) ? static_cast<void>(0) : qt_assert("contextData", __FILE__, 2034)); | - | ||||||||||||||||||||||||
| 1749 | - | |||||||||||||||||||||||||
| 1750 | QQmlData *data = QQmlData::get(object); | - | ||||||||||||||||||||||||
| 1751 | ((data) ? static_cast<void>(0) : qt_assert("data", __FILE__, 2037)); | - | ||||||||||||||||||||||||
| 1752 | if (data->ownContext
| 0-22268 | ||||||||||||||||||||||||
| 1753 | data->ownContext->clearContext(); | - | ||||||||||||||||||||||||
| 1754 | if (data->ownContext->contextObject == object
| 0-22268 | ||||||||||||||||||||||||
| 1755 | data->ownContext->contextObject = nullptr; executed 22268 times by 12 tests: data->ownContext->contextObject = nullptr;Executed by:
| 22268 | ||||||||||||||||||||||||
| 1756 | data->ownContext = nullptr; | - | ||||||||||||||||||||||||
| 1757 | data->context = nullptr; | - | ||||||||||||||||||||||||
| 1758 | } executed 22268 times by 12 tests: end of blockExecuted by:
| 22268 | ||||||||||||||||||||||||
| 1759 | object->deleteLater(); | - | ||||||||||||||||||||||||
| 1760 | - | |||||||||||||||||||||||||
| 1761 | if (attached
| 12-22256 | ||||||||||||||||||||||||
| 1762 | attached->m_cacheItem = nullptr; | - | ||||||||||||||||||||||||
| 1763 | attached = nullptr; | - | ||||||||||||||||||||||||
| 1764 | } executed 12 times by 2 tests: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||
| 1765 | - | |||||||||||||||||||||||||
| 1766 | contextData->invalidate(); | - | ||||||||||||||||||||||||
| 1767 | contextData = nullptr; | - | ||||||||||||||||||||||||
| 1768 | object = nullptr; | - | ||||||||||||||||||||||||
| 1769 | } executed 22268 times by 12 tests: end of blockExecuted by:
| 22268 | ||||||||||||||||||||||||
| 1770 | - | |||||||||||||||||||||||||
| 1771 | QQmlDelegateModelItem *QQmlDelegateModelItem::dataForObject(QObject *object) | - | ||||||||||||||||||||||||
| 1772 | { | - | ||||||||||||||||||||||||
| 1773 | QQmlData *d = QQmlData::get(object); | - | ||||||||||||||||||||||||
| 1774 | QQmlContextData *context = d
| 0-205348 | ||||||||||||||||||||||||
| 1775 | for (context = context ? context->parent : nullptr; context
| 84803-121461 | ||||||||||||||||||||||||
| 1776 | if (QQmlDelegateModelItem *cacheItem = qobject_cast<QQmlDelegateModelItem *>(
| 916-83887 | ||||||||||||||||||||||||
| 1777 | context->contextObject)
| 916-83887 | ||||||||||||||||||||||||
| 1778 | return executed 83887 times by 20 tests: cacheItem;return cacheItem;Executed by:
executed 83887 times by 20 tests: return cacheItem;Executed by:
| 83887 | ||||||||||||||||||||||||
| 1779 | } | - | ||||||||||||||||||||||||
| 1780 | } executed 916 times by 4 tests: end of blockExecuted by:
| 916 | ||||||||||||||||||||||||
| 1781 | return executed 121461 times by 23 tests: nullptr;return nullptr;Executed by:
executed 121461 times by 23 tests: return nullptr;Executed by:
| 121461 | ||||||||||||||||||||||||
| 1782 | } | - | ||||||||||||||||||||||||
| 1783 | - | |||||||||||||||||||||||||
| 1784 | int QQmlDelegateModelItem::groupIndex(Compositor::Group group) | - | ||||||||||||||||||||||||
| 1785 | { | - | ||||||||||||||||||||||||
| 1786 | if (QQmlDelegateModelPrivate * const model = metaType->model
| 0-54076 | ||||||||||||||||||||||||
| 1787 | ? QQmlDelegateModelPrivate::get(metaType->model)
| 0-54076 | ||||||||||||||||||||||||
| 1788 | : nullptr
| 0-54076 | ||||||||||||||||||||||||
| 1789 | return executed 54076 times by 4 tests: model->m_compositor.find(Compositor::Cache, model->m_cache.indexOf(this)).index[group];return model->m_compositor.find(Compositor::Cache, model->m_cache.indexOf(this)).index[group];Executed by:
executed 54076 times by 4 tests: return model->m_compositor.find(Compositor::Cache, model->m_cache.indexOf(this)).index[group];Executed by:
| 54076 | ||||||||||||||||||||||||
| 1790 | } | - | ||||||||||||||||||||||||
| 1791 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 1792 | } | - | ||||||||||||||||||||||||
| 1793 | - | |||||||||||||||||||||||||
| 1794 | - | |||||||||||||||||||||||||
| 1795 | - | |||||||||||||||||||||||||
| 1796 | QQmlDelegateModelAttachedMetaObject::QQmlDelegateModelAttachedMetaObject( | - | ||||||||||||||||||||||||
| 1797 | QQmlDelegateModelItemMetaType *metaType, QMetaObject *metaObject) | - | ||||||||||||||||||||||||
| 1798 | : metaType(metaType) | - | ||||||||||||||||||||||||
| 1799 | , metaObject(metaObject) | - | ||||||||||||||||||||||||
| 1800 | , memberPropertyOffset(QQmlDelegateModelAttached::staticMetaObject.propertyCount()) | - | ||||||||||||||||||||||||
| 1801 | , indexPropertyOffset(QQmlDelegateModelAttached::staticMetaObject.propertyCount() + metaType->groupNames.count()) | - | ||||||||||||||||||||||||
| 1802 | { | - | ||||||||||||||||||||||||
| 1803 | - | |||||||||||||||||||||||||
| 1804 | - | |||||||||||||||||||||||||
| 1805 | - | |||||||||||||||||||||||||
| 1806 | *static_cast<QMetaObject *>(this) = *metaObject; | - | ||||||||||||||||||||||||
| 1807 | } executed 438 times by 3 tests: end of blockExecuted by:
| 438 | ||||||||||||||||||||||||
| 1808 | - | |||||||||||||||||||||||||
| 1809 | QQmlDelegateModelAttachedMetaObject::~QQmlDelegateModelAttachedMetaObject() | - | ||||||||||||||||||||||||
| 1810 | { | - | ||||||||||||||||||||||||
| 1811 | ::free(metaObject); | - | ||||||||||||||||||||||||
| 1812 | } executed 438 times by 3 tests: end of blockExecuted by:
| 438 | ||||||||||||||||||||||||
| 1813 | - | |||||||||||||||||||||||||
| 1814 | void QQmlDelegateModelAttachedMetaObject::objectDestroyed(QObject *) | - | ||||||||||||||||||||||||
| 1815 | { | - | ||||||||||||||||||||||||
| 1816 | release(); | - | ||||||||||||||||||||||||
| 1817 | } executed 2290 times by 3 tests: end of blockExecuted by:
| 2290 | ||||||||||||||||||||||||
| 1818 | - | |||||||||||||||||||||||||
| 1819 | int QQmlDelegateModelAttachedMetaObject::metaCall(QObject *object, QMetaObject::Call call, int _id, void **arguments) | - | ||||||||||||||||||||||||
| 1820 | { | - | ||||||||||||||||||||||||
| 1821 | QQmlDelegateModelAttached *attached = static_cast<QQmlDelegateModelAttached *>(object); | - | ||||||||||||||||||||||||
| 1822 | if (call == QMetaObject::ReadProperty
| 82-20306 | ||||||||||||||||||||||||
| 1823 | if (_id >= indexPropertyOffset
| 9276-11030 | ||||||||||||||||||||||||
| 1824 | Compositor::Group group = Compositor::Group(_id - indexPropertyOffset + 1); | - | ||||||||||||||||||||||||
| 1825 | *static_cast<int *>(arguments[0]) = attached->m_currentIndex[group]; | - | ||||||||||||||||||||||||
| 1826 | return executed 9276 times by 3 tests: -1;return -1;Executed by:
executed 9276 times by 3 tests: return -1;Executed by:
| 9276 | ||||||||||||||||||||||||
| 1827 | } else if (_id >= memberPropertyOffset
| 2240-8790 | ||||||||||||||||||||||||
| 1828 | Compositor::Group group = Compositor::Group(_id - memberPropertyOffset + 1); | - | ||||||||||||||||||||||||
| 1829 | *static_cast<bool *>(arguments[0]) = attached->m_cacheItem->groups & (1 << group); | - | ||||||||||||||||||||||||
| 1830 | return executed 8790 times by 2 tests: -1;return -1;Executed by:
executed 8790 times by 2 tests: return -1;Executed by:
| 8790 | ||||||||||||||||||||||||
| 1831 | } | - | ||||||||||||||||||||||||
| 1832 | } executed 2240 times by 1 test: else if (call == QMetaObject::WritePropertyend of blockExecuted by:
| 0-2240 | ||||||||||||||||||||||||
| 1833 | if (_id >= memberPropertyOffset
| 2-80 | ||||||||||||||||||||||||
| 1834 | if (!metaType->model
| 0-80 | ||||||||||||||||||||||||
| 1835 | return never executed: -1;return -1;never executed: return -1; | 0 | ||||||||||||||||||||||||
| 1836 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(metaType->model); | - | ||||||||||||||||||||||||
| 1837 | Compositor::Group group = Compositor::Group(_id - memberPropertyOffset + 1); | - | ||||||||||||||||||||||||
| 1838 | const int groupFlag = 1 << group; | - | ||||||||||||||||||||||||
| 1839 | const bool member = attached->m_cacheItem->groups & groupFlag; | - | ||||||||||||||||||||||||
| 1840 | if (member
| 4-76 | ||||||||||||||||||||||||
| 1841 | Compositor::iterator it = model->m_compositor.find( | - | ||||||||||||||||||||||||
| 1842 | group, attached->m_currentIndex[group]); | - | ||||||||||||||||||||||||
| 1843 | model->removeGroups(it, 1, group, groupFlag); | - | ||||||||||||||||||||||||
| 1844 | } executed 6 times by 1 test: else if (!memberend of blockExecuted by:
| 0-70 | ||||||||||||||||||||||||
| 1845 | for (int i = 1; i < metaType->groupCount
| 0-4 | ||||||||||||||||||||||||
| 1846 | if (attached->m_cacheItem->groups & (1 << i)
| 0-4 | ||||||||||||||||||||||||
| 1847 | Compositor::iterator it = model->m_compositor.find( | - | ||||||||||||||||||||||||
| 1848 | Compositor::Group(i), attached->m_currentIndex[i]); | - | ||||||||||||||||||||||||
| 1849 | model->addGroups(it, 1, Compositor::Group(i), groupFlag); | - | ||||||||||||||||||||||||
| 1850 | break; executed 4 times by 1 test: break;Executed by:
| 4 | ||||||||||||||||||||||||
| 1851 | } | - | ||||||||||||||||||||||||
| 1852 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 1853 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 1854 | return executed 80 times by 2 tests: -1;return -1;Executed by:
executed 80 times by 2 tests: return -1;Executed by:
| 80 | ||||||||||||||||||||||||
| 1855 | } | - | ||||||||||||||||||||||||
| 1856 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 1857 | return executed 2242 times by 1 test: attached->qt_metacall(call, _id, arguments);return attached->qt_metacall(call, _id, arguments);Executed by:
executed 2242 times by 1 test: return attached->qt_metacall(call, _id, arguments);Executed by:
| 2242 | ||||||||||||||||||||||||
| 1858 | } | - | ||||||||||||||||||||||||
| 1859 | - | |||||||||||||||||||||||||
| 1860 | QQmlDelegateModelAttached::QQmlDelegateModelAttached(QObject *parent) | - | ||||||||||||||||||||||||
| 1861 | : m_cacheItem(nullptr) | - | ||||||||||||||||||||||||
| 1862 | , m_previousGroups(0) | - | ||||||||||||||||||||||||
| 1863 | { | - | ||||||||||||||||||||||||
| 1864 | QQml_setParent_noEvent(this, parent); | - | ||||||||||||||||||||||||
| 1865 | } executed 4 times by 1 test: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 1866 | - | |||||||||||||||||||||||||
| 1867 | QQmlDelegateModelAttached::QQmlDelegateModelAttached( | - | ||||||||||||||||||||||||
| 1868 | QQmlDelegateModelItem *cacheItem, QObject *parent) | - | ||||||||||||||||||||||||
| 1869 | : m_cacheItem(cacheItem) | - | ||||||||||||||||||||||||
| 1870 | , m_previousGroups(cacheItem->groups) | - | ||||||||||||||||||||||||
| 1871 | { | - | ||||||||||||||||||||||||
| 1872 | QQml_setParent_noEvent(this, parent); | - | ||||||||||||||||||||||||
| 1873 | resetCurrentIndex(); | - | ||||||||||||||||||||||||
| 1874 | - | |||||||||||||||||||||||||
| 1875 | std::copy(std::begin(m_currentIndex), std::end(m_currentIndex), std::begin(m_previousIndex)); | - | ||||||||||||||||||||||||
| 1876 | - | |||||||||||||||||||||||||
| 1877 | if (!cacheItem->metaType->metaObject
| 438-1852 | ||||||||||||||||||||||||
| 1878 | cacheItem->metaType->initializeMetaObject(); executed 438 times by 3 tests: cacheItem->metaType->initializeMetaObject();Executed by:
| 438 | ||||||||||||||||||||||||
| 1879 | - | |||||||||||||||||||||||||
| 1880 | QObjectPrivate::get(this)->metaObject = cacheItem->metaType->metaObject; | - | ||||||||||||||||||||||||
| 1881 | cacheItem->metaType->metaObject->addref(); | - | ||||||||||||||||||||||||
| 1882 | } executed 2290 times by 3 tests: end of blockExecuted by:
| 2290 | ||||||||||||||||||||||||
| 1883 | - | |||||||||||||||||||||||||
| 1884 | void QQmlDelegateModelAttached::resetCurrentIndex() | - | ||||||||||||||||||||||||
| 1885 | { | - | ||||||||||||||||||||||||
| 1886 | if (QQDMIncubationTask *incubationTask = m_cacheItem->incubationTask
| 288-2002 | ||||||||||||||||||||||||
| 1887 | for (int i = 1; i < qMin<int>(m_cacheItem->metaType->groupCount, Compositor::MaximumGroupCount)
| 288-982 | ||||||||||||||||||||||||
| 1888 | m_currentIndex[i] = incubationTask->index[i]; executed 982 times by 2 tests: m_currentIndex[i] = incubationTask->index[i];Executed by:
| 982 | ||||||||||||||||||||||||
| 1889 | } executed 288 times by 2 tests: else {end of blockExecuted by:
| 288 | ||||||||||||||||||||||||
| 1890 | QQmlDelegateModelPrivate * const model = QQmlDelegateModelPrivate::get(m_cacheItem->metaType->model); | - | ||||||||||||||||||||||||
| 1891 | Compositor::iterator it = model->m_compositor.find( | - | ||||||||||||||||||||||||
| 1892 | Compositor::Cache, model->m_cache.indexOf(m_cacheItem)); | - | ||||||||||||||||||||||||
| 1893 | for (int i = 1; i < m_cacheItem->metaType->groupCount
| 2002-7980 | ||||||||||||||||||||||||
| 1894 | m_currentIndex[i] = it.index[i]; executed 7980 times by 2 tests: m_currentIndex[i] = it.index[i];Executed by:
| 7980 | ||||||||||||||||||||||||
| 1895 | } executed 2002 times by 2 tests: end of blockExecuted by:
| 2002 | ||||||||||||||||||||||||
| 1896 | } | - | ||||||||||||||||||||||||
| 1897 | QQmlDelegateModel *QQmlDelegateModelAttached::model() const | - | ||||||||||||||||||||||||
| 1898 | { | - | ||||||||||||||||||||||||
| 1899 | return executed 6 times by 1 test: m_cacheItem ? m_cacheItem->metaType->model : nullptr;return m_cacheItem ? m_cacheItem->metaType->model : nullptr;Executed by:
executed 6 times by 1 test: return m_cacheItem ? m_cacheItem->metaType->model : nullptr;Executed by:
| 6 | ||||||||||||||||||||||||
| 1900 | } | - | ||||||||||||||||||||||||
| 1901 | QStringList QQmlDelegateModelAttached::groups() const | - | ||||||||||||||||||||||||
| 1902 | { | - | ||||||||||||||||||||||||
| 1903 | QStringList groups; | - | ||||||||||||||||||||||||
| 1904 | - | |||||||||||||||||||||||||
| 1905 | if (!m_cacheItem
| 0-250 | ||||||||||||||||||||||||
| 1906 | return never executed: groups;return groups;never executed: return groups; | 0 | ||||||||||||||||||||||||
| 1907 | for (int i = 1; i < m_cacheItem->metaType->groupCount
| 250-1000 | ||||||||||||||||||||||||
| 1908 | if (m_cacheItem->groups & (1 << i)
| 480-520 | ||||||||||||||||||||||||
| 1909 | groups.append(m_cacheItem->metaType->groupNames.at(i - 1)); executed 480 times by 1 test: groups.append(m_cacheItem->metaType->groupNames.at(i - 1));Executed by:
| 480 | ||||||||||||||||||||||||
| 1910 | } executed 1000 times by 1 test: end of blockExecuted by:
| 1000 | ||||||||||||||||||||||||
| 1911 | return executed 250 times by 1 test: groups;return groups;Executed by:
executed 250 times by 1 test: return groups;Executed by:
| 250 | ||||||||||||||||||||||||
| 1912 | } | - | ||||||||||||||||||||||||
| 1913 | - | |||||||||||||||||||||||||
| 1914 | void QQmlDelegateModelAttached::setGroups(const QStringList &groups) | - | ||||||||||||||||||||||||
| 1915 | { | - | ||||||||||||||||||||||||
| 1916 | if (!m_cacheItem
| 0-2 | ||||||||||||||||||||||||
| 1917 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 1918 | - | |||||||||||||||||||||||||
| 1919 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_cacheItem->metaType->model); | - | ||||||||||||||||||||||||
| 1920 | - | |||||||||||||||||||||||||
| 1921 | const int groupFlags = model->m_cacheMetaType->parseGroups(groups); | - | ||||||||||||||||||||||||
| 1922 | const int cacheIndex = model->m_cache.indexOf(m_cacheItem); | - | ||||||||||||||||||||||||
| 1923 | Compositor::iterator it = model->m_compositor.find(Compositor::Cache, cacheIndex); | - | ||||||||||||||||||||||||
| 1924 | model->setGroups(it, 1, Compositor::Cache, groupFlags); | - | ||||||||||||||||||||||||
| 1925 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 1926 | bool QQmlDelegateModelAttached::isUnresolved() const | - | ||||||||||||||||||||||||
| 1927 | { | - | ||||||||||||||||||||||||
| 1928 | if (!m_cacheItem
| 0-1988 | ||||||||||||||||||||||||
| 1929 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 1930 | - | |||||||||||||||||||||||||
| 1931 | return executed 1988 times by 1 test: m_cacheItem->groups & Compositor::UnresolvedFlag;return m_cacheItem->groups & Compositor::UnresolvedFlag;Executed by:
executed 1988 times by 1 test: return m_cacheItem->groups & Compositor::UnresolvedFlag;Executed by:
| 1988 | ||||||||||||||||||||||||
| 1932 | } | - | ||||||||||||||||||||||||
| 1933 | void QQmlDelegateModelAttached::emitChanges() | - | ||||||||||||||||||||||||
| 1934 | { | - | ||||||||||||||||||||||||
| 1935 | const int groupChanges = m_previousGroups ^ m_cacheItem->groups; | - | ||||||||||||||||||||||||
| 1936 | m_previousGroups = m_cacheItem->groups; | - | ||||||||||||||||||||||||
| 1937 | - | |||||||||||||||||||||||||
| 1938 | int indexChanges = 0; | - | ||||||||||||||||||||||||
| 1939 | for (int i = 1; i < m_cacheItem->metaType->groupCount
| 2324-9240 | ||||||||||||||||||||||||
| 1940 | if (m_previousIndex[i] != m_currentIndex[i]
| 1294-7946 | ||||||||||||||||||||||||
| 1941 | m_previousIndex[i] = m_currentIndex[i]; | - | ||||||||||||||||||||||||
| 1942 | indexChanges |= (1 << i); | - | ||||||||||||||||||||||||
| 1943 | } executed 1294 times by 2 tests: end of blockExecuted by:
| 1294 | ||||||||||||||||||||||||
| 1944 | } executed 9240 times by 2 tests: end of blockExecuted by:
| 9240 | ||||||||||||||||||||||||
| 1945 | - | |||||||||||||||||||||||||
| 1946 | int notifierId = 0; | - | ||||||||||||||||||||||||
| 1947 | const QMetaObject *meta = metaObject(); | - | ||||||||||||||||||||||||
| 1948 | for (int i = 1; i < m_cacheItem->metaType->groupCount
| 2324-9240 | ||||||||||||||||||||||||
| 1949 | if (groupChanges & (1 << i)
| 112-9128 | ||||||||||||||||||||||||
| 1950 | QMetaObject::activate(this, meta, notifierId, nullptr); executed 112 times by 1 test: QMetaObject::activate(this, meta, notifierId, nullptr);Executed by:
| 112 | ||||||||||||||||||||||||
| 1951 | } executed 9240 times by 2 tests: end of blockExecuted by:
| 9240 | ||||||||||||||||||||||||
| 1952 | for (int i = 1; i < m_cacheItem->metaType->groupCount
| 2324-9240 | ||||||||||||||||||||||||
| 1953 | if (indexChanges & (1 << i)
| 1294-7946 | ||||||||||||||||||||||||
| 1954 | QMetaObject::activate(this, meta, notifierId, nullptr); executed 1294 times by 2 tests: QMetaObject::activate(this, meta, notifierId, nullptr);Executed by:
| 1294 | ||||||||||||||||||||||||
| 1955 | } executed 9240 times by 2 tests: end of blockExecuted by:
| 9240 | ||||||||||||||||||||||||
| 1956 | - | |||||||||||||||||||||||||
| 1957 | if (groupChanges
| 92-2232 | ||||||||||||||||||||||||
| 1958 | groupsChanged(); executed 92 times by 1 test: groupsChanged();Executed by:
| 92 | ||||||||||||||||||||||||
| 1959 | } executed 2324 times by 2 tests: end of blockExecuted by:
| 2324 | ||||||||||||||||||||||||
| 1960 | - | |||||||||||||||||||||||||
| 1961 | - | |||||||||||||||||||||||||
| 1962 | - | |||||||||||||||||||||||||
| 1963 | void QQmlDelegateModelGroupPrivate::setModel(QQmlDelegateModel *m, Compositor::Group g) | - | ||||||||||||||||||||||||
| 1964 | { | - | ||||||||||||||||||||||||
| 1965 | ((!model) ? static_cast<void>(0) : qt_assert("!model", __FILE__, 2321)); | - | ||||||||||||||||||||||||
| 1966 | model = m; | - | ||||||||||||||||||||||||
| 1967 | group = g; | - | ||||||||||||||||||||||||
| 1968 | } executed 12316 times by 27 tests: end of blockExecuted by:
| 12316 | ||||||||||||||||||||||||
| 1969 | - | |||||||||||||||||||||||||
| 1970 | bool QQmlDelegateModelGroupPrivate::isChangedConnected() | - | ||||||||||||||||||||||||
| 1971 | { | - | ||||||||||||||||||||||||
| 1972 | QQmlDelegateModelGroup * const q = q_func(); | - | ||||||||||||||||||||||||
| 1973 | do { QObject *sender = (q); void (QQmlDelegateModelGroup::*signal)(const QQmlV4Handle &,const QQmlV4Handle &) = &QQmlDelegateModelGroup::changed; static QMetaMethod method = QMetaMethod::fromSignal(signal); static int signalIdx = QMetaObjectPrivate::signalIndex(method); return executed 41120 times by 27 tests: QObjectPrivate::get(sender)->isSignalConnected(signalIdx);return QObjectPrivate::get(sender)->isSignalConnected(signalIdx);Executed by:
executed 41120 times by 27 tests: } while (0);return QObjectPrivate::get(sender)->isSignalConnected(signalIdx);Executed by:
| 41120 | ||||||||||||||||||||||||
| 1974 | } | - | ||||||||||||||||||||||||
| 1975 | - | |||||||||||||||||||||||||
| 1976 | void QQmlDelegateModelGroupPrivate::emitChanges(QV4::ExecutionEngine *v4) | - | ||||||||||||||||||||||||
| 1977 | { | - | ||||||||||||||||||||||||
| 1978 | QQmlDelegateModelGroup * const q = q_func(); | - | ||||||||||||||||||||||||
| 1979 | if (isChangedConnected()
| 46-40992 | ||||||||||||||||||||||||
| 1980 | QV4::Scope scope(v4); | - | ||||||||||||||||||||||||
| 1981 | QV4::ScopedValue removed(scope, engineData(scope.engine)->array(v4, changeSet.removes())); | - | ||||||||||||||||||||||||
| 1982 | QV4::ScopedValue inserted(scope, engineData(scope.engine)->array(v4, changeSet.inserts())); | - | ||||||||||||||||||||||||
| 1983 | q->changed(QQmlV4Handle(removed), QQmlV4Handle(inserted)); | - | ||||||||||||||||||||||||
| 1984 | } executed 82 times by 2 tests: end of blockExecuted by:
| 82 | ||||||||||||||||||||||||
| 1985 | if (changeSet.difference() != 0
| 16458-24662 | ||||||||||||||||||||||||
| 1986 | q->countChanged(); executed 16458 times by 25 tests: q->countChanged();Executed by:
| 16458 | ||||||||||||||||||||||||
| 1987 | } executed 41120 times by 27 tests: end of blockExecuted by:
| 41120 | ||||||||||||||||||||||||
| 1988 | - | |||||||||||||||||||||||||
| 1989 | void QQmlDelegateModelGroupPrivate::emitModelUpdated(bool reset) | - | ||||||||||||||||||||||||
| 1990 | { | - | ||||||||||||||||||||||||
| 1991 | for (QQmlDelegateModelGroupEmitterList::iterator it = emitters.begin(); it != emitters.end()
| 20350-41120 | ||||||||||||||||||||||||
| 1992 | it->emitModelUpdated(changeSet, reset); executed 20350 times by 27 tests: it->emitModelUpdated(changeSet, reset);Executed by:
| 20350 | ||||||||||||||||||||||||
| 1993 | changeSet.clear(); | - | ||||||||||||||||||||||||
| 1994 | } executed 41120 times by 27 tests: end of blockExecuted by:
| 41120 | ||||||||||||||||||||||||
| 1995 | - | |||||||||||||||||||||||||
| 1996 | typedef QQmlDelegateModelGroupEmitterList::iterator GroupEmitterListIt; | - | ||||||||||||||||||||||||
| 1997 | - | |||||||||||||||||||||||||
| 1998 | void QQmlDelegateModelGroupPrivate::createdPackage(int index, QQuickPackage *package) | - | ||||||||||||||||||||||||
| 1999 | { | - | ||||||||||||||||||||||||
| 2000 | for (GroupEmitterListIt it = emitters.begin(), end = emitters.end(); it != end
| 10188-12098 | ||||||||||||||||||||||||
| 2001 | it->createdPackage(index, package); executed 10188 times by 6 tests: it->createdPackage(index, package);Executed by:
| 10188 | ||||||||||||||||||||||||
| 2002 | } executed 12098 times by 6 tests: end of blockExecuted by:
| 12098 | ||||||||||||||||||||||||
| 2003 | - | |||||||||||||||||||||||||
| 2004 | void QQmlDelegateModelGroupPrivate::initPackage(int index, QQuickPackage *package) | - | ||||||||||||||||||||||||
| 2005 | { | - | ||||||||||||||||||||||||
| 2006 | for (GroupEmitterListIt it = emitters.begin(), end = emitters.end(); it != end
| 10188-12098 | ||||||||||||||||||||||||
| 2007 | it->initPackage(index, package); executed 10188 times by 6 tests: it->initPackage(index, package);Executed by:
| 10188 | ||||||||||||||||||||||||
| 2008 | } executed 12098 times by 6 tests: end of blockExecuted by:
| 12098 | ||||||||||||||||||||||||
| 2009 | - | |||||||||||||||||||||||||
| 2010 | void QQmlDelegateModelGroupPrivate::destroyingPackage(QQuickPackage *package) | - | ||||||||||||||||||||||||
| 2011 | { | - | ||||||||||||||||||||||||
| 2012 | for (GroupEmitterListIt it = emitters.begin(), end = emitters.end(); it != end
| 3324-3356 | ||||||||||||||||||||||||
| 2013 | it->destroyingPackage(package); executed 3356 times by 3 tests: it->destroyingPackage(package);Executed by:
| 3356 | ||||||||||||||||||||||||
| 2014 | } executed 3324 times by 3 tests: end of blockExecuted by:
| 3324 | ||||||||||||||||||||||||
| 2015 | QQmlDelegateModelGroup::QQmlDelegateModelGroup(QObject *parent) | - | ||||||||||||||||||||||||
| 2016 | : QObject(*new QQmlDelegateModelGroupPrivate, parent) | - | ||||||||||||||||||||||||
| 2017 | { | - | ||||||||||||||||||||||||
| 2018 | } executed 12322 times by 27 tests: end of blockExecuted by:
| 12322 | ||||||||||||||||||||||||
| 2019 | - | |||||||||||||||||||||||||
| 2020 | QQmlDelegateModelGroup::QQmlDelegateModelGroup( | - | ||||||||||||||||||||||||
| 2021 | const QString &name, QQmlDelegateModel *model, int index, QObject *parent) | - | ||||||||||||||||||||||||
| 2022 | : QQmlDelegateModelGroup(parent) | - | ||||||||||||||||||||||||
| 2023 | { | - | ||||||||||||||||||||||||
| 2024 | QQmlDelegateModelGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2025 | d->name = name; | - | ||||||||||||||||||||||||
| 2026 | d->setModel(model, Compositor::Group(index)); | - | ||||||||||||||||||||||||
| 2027 | } executed 11244 times by 27 tests: end of blockExecuted by:
| 11244 | ||||||||||||||||||||||||
| 2028 | - | |||||||||||||||||||||||||
| 2029 | QQmlDelegateModelGroup::~QQmlDelegateModelGroup() | - | ||||||||||||||||||||||||
| 2030 | { | - | ||||||||||||||||||||||||
| 2031 | } | - | ||||||||||||||||||||||||
| 2032 | QString QQmlDelegateModelGroup::name() const | - | ||||||||||||||||||||||||
| 2033 | { | - | ||||||||||||||||||||||||
| 2034 | const QQmlDelegateModelGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2035 | return executed 1084 times by 2 tests: d->name;return d->name;Executed by:
executed 1084 times by 2 tests: return d->name;Executed by:
| 1084 | ||||||||||||||||||||||||
| 2036 | } | - | ||||||||||||||||||||||||
| 2037 | - | |||||||||||||||||||||||||
| 2038 | void QQmlDelegateModelGroup::setName(const QString &name) | - | ||||||||||||||||||||||||
| 2039 | { | - | ||||||||||||||||||||||||
| 2040 | QQmlDelegateModelGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2041 | if (d->model
| 0-1074 | ||||||||||||||||||||||||
| 2042 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2043 | if (d->name != name
| 0-1074 | ||||||||||||||||||||||||
| 2044 | d->name = name; | - | ||||||||||||||||||||||||
| 2045 | nameChanged(); | - | ||||||||||||||||||||||||
| 2046 | } executed 1074 times by 2 tests: end of blockExecuted by:
| 1074 | ||||||||||||||||||||||||
| 2047 | } executed 1074 times by 2 tests: end of blockExecuted by:
| 1074 | ||||||||||||||||||||||||
| 2048 | - | |||||||||||||||||||||||||
| 2049 | - | |||||||||||||||||||||||||
| 2050 | - | |||||||||||||||||||||||||
| 2051 | - | |||||||||||||||||||||||||
| 2052 | - | |||||||||||||||||||||||||
| 2053 | - | |||||||||||||||||||||||||
| 2054 | - | |||||||||||||||||||||||||
| 2055 | int QQmlDelegateModelGroup::count() const | - | ||||||||||||||||||||||||
| 2056 | { | - | ||||||||||||||||||||||||
| 2057 | const QQmlDelegateModelGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2058 | if (!d->model
| 0-2110 | ||||||||||||||||||||||||
| 2059 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||||||||
| 2060 | return executed 2110 times by 2 tests: QQmlDelegateModelPrivate::get(d->model)->m_compositor.count(d->group);return QQmlDelegateModelPrivate::get(d->model)->m_compositor.count(d->group);Executed by:
executed 2110 times by 2 tests: return QQmlDelegateModelPrivate::get(d->model)->m_compositor.count(d->group);Executed by:
| 2110 | ||||||||||||||||||||||||
| 2061 | } | - | ||||||||||||||||||||||||
| 2062 | - | |||||||||||||||||||||||||
| 2063 | - | |||||||||||||||||||||||||
| 2064 | - | |||||||||||||||||||||||||
| 2065 | - | |||||||||||||||||||||||||
| 2066 | - | |||||||||||||||||||||||||
| 2067 | - | |||||||||||||||||||||||||
| 2068 | - | |||||||||||||||||||||||||
| 2069 | bool QQmlDelegateModelGroup::defaultInclude() const | - | ||||||||||||||||||||||||
| 2070 | { | - | ||||||||||||||||||||||||
| 2071 | const QQmlDelegateModelGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2072 | return never executed: d->defaultInclude;return d->defaultInclude;never executed: return d->defaultInclude; | 0 | ||||||||||||||||||||||||
| 2073 | } | - | ||||||||||||||||||||||||
| 2074 | - | |||||||||||||||||||||||||
| 2075 | void QQmlDelegateModelGroup::setDefaultInclude(bool include) | - | ||||||||||||||||||||||||
| 2076 | { | - | ||||||||||||||||||||||||
| 2077 | QQmlDelegateModelGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2078 | if (d->defaultInclude != include
| 0-6164 | ||||||||||||||||||||||||
| 2079 | d->defaultInclude = include; | - | ||||||||||||||||||||||||
| 2080 | - | |||||||||||||||||||||||||
| 2081 | if (d->model
| 536-5628 | ||||||||||||||||||||||||
| 2082 | if (include
| 4-5624 | ||||||||||||||||||||||||
| 2083 | QQmlDelegateModelPrivate::get(d->model)->m_compositor.setDefaultGroup(d->group); executed 5624 times by 27 tests: QQmlDelegateModelPrivate::get(d->model)->m_compositor.setDefaultGroup(d->group);Executed by:
| 5624 | ||||||||||||||||||||||||
| 2084 | else | - | ||||||||||||||||||||||||
| 2085 | QQmlDelegateModelPrivate::get(d->model)->m_compositor.clearDefaultGroup(d->group); executed 4 times by 2 tests: QQmlDelegateModelPrivate::get(d->model)->m_compositor.clearDefaultGroup(d->group);Executed by:
| 4 | ||||||||||||||||||||||||
| 2086 | } | - | ||||||||||||||||||||||||
| 2087 | defaultIncludeChanged(); | - | ||||||||||||||||||||||||
| 2088 | } executed 6164 times by 27 tests: end of blockExecuted by:
| 6164 | ||||||||||||||||||||||||
| 2089 | } executed 6164 times by 27 tests: end of blockExecuted by:
| 6164 | ||||||||||||||||||||||||
| 2090 | QQmlV4Handle QQmlDelegateModelGroup::get(int index) | - | ||||||||||||||||||||||||
| 2091 | { | - | ||||||||||||||||||||||||
| 2092 | QQmlDelegateModelGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2093 | if (!d->model
| 0-26788 | ||||||||||||||||||||||||
| 2094 | return never executed: QQmlV4Handle(QV4::Encode::undefined());return QQmlV4Handle(QV4::Encode::undefined());never executed: return QQmlV4Handle(QV4::Encode::undefined()); | 0 | ||||||||||||||||||||||||
| 2095 | - | |||||||||||||||||||||||||
| 2096 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model); | - | ||||||||||||||||||||||||
| 2097 | if (!model->m_context
| 0-26788 | ||||||||||||||||||||||||
| 2098 | return never executed: QQmlV4Handle(QV4::Encode::undefined());return QQmlV4Handle(QV4::Encode::undefined());never executed: return QQmlV4Handle(QV4::Encode::undefined()); | 0 | ||||||||||||||||||||||||
| 2099 | } else if (index < 0
| 0-26788 | ||||||||||||||||||||||||
| 2100 | qmlWarning(this) << tr("get: index out of range"); | - | ||||||||||||||||||||||||
| 2101 | return executed 2 times by 1 test: QQmlV4Handle(QV4::Encode::undefined());return QQmlV4Handle(QV4::Encode::undefined());Executed by:
executed 2 times by 1 test: return QQmlV4Handle(QV4::Encode::undefined());Executed by:
| 2 | ||||||||||||||||||||||||
| 2102 | } | - | ||||||||||||||||||||||||
| 2103 | - | |||||||||||||||||||||||||
| 2104 | Compositor::iterator it = model->m_compositor.find(d->group, index); | - | ||||||||||||||||||||||||
| 2105 | QQmlDelegateModelItem *cacheItem = it->inCache()
| 52-26734 | ||||||||||||||||||||||||
| 2106 | ? model->m_cache.at(it.cacheIndex) | - | ||||||||||||||||||||||||
| 2107 | : 0; | - | ||||||||||||||||||||||||
| 2108 | - | |||||||||||||||||||||||||
| 2109 | if (!cacheItem
| 52-26734 | ||||||||||||||||||||||||
| 2110 | cacheItem = model->m_adaptorModel.createItem( | - | ||||||||||||||||||||||||
| 2111 | model->m_cacheMetaType, it.modelIndex()); | - | ||||||||||||||||||||||||
| 2112 | if (!cacheItem
| 0-52 | ||||||||||||||||||||||||
| 2113 | return never executed: QQmlV4Handle(QV4::Encode::undefined());return QQmlV4Handle(QV4::Encode::undefined());never executed: return QQmlV4Handle(QV4::Encode::undefined()); | 0 | ||||||||||||||||||||||||
| 2114 | cacheItem->groups = it->flags; | - | ||||||||||||||||||||||||
| 2115 | - | |||||||||||||||||||||||||
| 2116 | model->m_cache.insert(it.cacheIndex, cacheItem); | - | ||||||||||||||||||||||||
| 2117 | model->m_compositor.setFlags(it, 1, Compositor::CacheFlag); | - | ||||||||||||||||||||||||
| 2118 | } executed 52 times by 2 tests: end of blockExecuted by:
| 52 | ||||||||||||||||||||||||
| 2119 | - | |||||||||||||||||||||||||
| 2120 | if (model->m_cacheMetaType->modelItemProto.isUndefined()
| 420-26366 | ||||||||||||||||||||||||
| 2121 | model->m_cacheMetaType->initializePrototype(); executed 420 times by 2 tests: model->m_cacheMetaType->initializePrototype();Executed by:
| 420 | ||||||||||||||||||||||||
| 2122 | QV4::ExecutionEngine *v4 = model->m_cacheMetaType->v4Engine; | - | ||||||||||||||||||||||||
| 2123 | QV4::Scope scope(v4); | - | ||||||||||||||||||||||||
| 2124 | QV4::ScopedObject o(scope, v4->memoryManager->allocate<QQmlDelegateModelItemObject>(cacheItem)); | - | ||||||||||||||||||||||||
| 2125 | QV4::ScopedObject p(scope, model->m_cacheMetaType->modelItemProto.value()); | - | ||||||||||||||||||||||||
| 2126 | o->setPrototypeOf(p); | - | ||||||||||||||||||||||||
| 2127 | ++cacheItem->scriptRef; | - | ||||||||||||||||||||||||
| 2128 | - | |||||||||||||||||||||||||
| 2129 | return executed 26786 times by 2 tests: QQmlV4Handle(o);return QQmlV4Handle(o);Executed by:
executed 26786 times by 2 tests: return QQmlV4Handle(o);Executed by:
| 26786 | ||||||||||||||||||||||||
| 2130 | } | - | ||||||||||||||||||||||||
| 2131 | - | |||||||||||||||||||||||||
| 2132 | bool QQmlDelegateModelGroupPrivate::parseIndex(const QV4::Value &value, int *index, Compositor::Group *group) const | - | ||||||||||||||||||||||||
| 2133 | { | - | ||||||||||||||||||||||||
| 2134 | if (value.isNumber()
| 186-1260 | ||||||||||||||||||||||||
| 2135 | *index = value.toInt32(); | - | ||||||||||||||||||||||||
| 2136 | return executed 1260 times by 3 tests: true;return true;Executed by:
executed 1260 times by 3 tests: return true;Executed by:
| 1260 | ||||||||||||||||||||||||
| 2137 | } | - | ||||||||||||||||||||||||
| 2138 | - | |||||||||||||||||||||||||
| 2139 | if (!value.isObject()
| 10-176 | ||||||||||||||||||||||||
| 2140 | return executed 10 times by 1 test: false;return false;Executed by:
executed 10 times by 1 test: return false;Executed by:
| 10 | ||||||||||||||||||||||||
| 2141 | - | |||||||||||||||||||||||||
| 2142 | QV4::ExecutionEngine *v4 = value.as<QV4::Object>()->engine(); | - | ||||||||||||||||||||||||
| 2143 | QV4::Scope scope(v4); | - | ||||||||||||||||||||||||
| 2144 | QV4::Scoped<QQmlDelegateModelItemObject> object(scope, value); | - | ||||||||||||||||||||||||
| 2145 | - | |||||||||||||||||||||||||
| 2146 | if (object
| 88 | ||||||||||||||||||||||||
| 2147 | QQmlDelegateModelItem * const cacheItem = object->d()->item; | - | ||||||||||||||||||||||||
| 2148 | if (QQmlDelegateModelPrivate *model = cacheItem->metaType->model
| 0-88 | ||||||||||||||||||||||||
| 2149 | ? QQmlDelegateModelPrivate::get(cacheItem->metaType->model)
| 0-88 | ||||||||||||||||||||||||
| 2150 | : nullptr
| 0-88 | ||||||||||||||||||||||||
| 2151 | *index = model->m_cache.indexOf(cacheItem); | - | ||||||||||||||||||||||||
| 2152 | *group = Compositor::Cache; | - | ||||||||||||||||||||||||
| 2153 | return executed 88 times by 1 test: true;return true;Executed by:
executed 88 times by 1 test: return true;Executed by:
| 88 | ||||||||||||||||||||||||
| 2154 | } | - | ||||||||||||||||||||||||
| 2155 | } never executed: end of block | 0 | ||||||||||||||||||||||||
| 2156 | return executed 88 times by 1 test: false;return false;Executed by:
executed 88 times by 1 test: return false;Executed by:
| 88 | ||||||||||||||||||||||||
| 2157 | } | - | ||||||||||||||||||||||||
| 2158 | void QQmlDelegateModelGroup::insert(QQmlV4Function *args) | - | ||||||||||||||||||||||||
| 2159 | { | - | ||||||||||||||||||||||||
| 2160 | QQmlDelegateModelGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2161 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model); | - | ||||||||||||||||||||||||
| 2162 | - | |||||||||||||||||||||||||
| 2163 | int index = model->m_compositor.count(d->group); | - | ||||||||||||||||||||||||
| 2164 | Compositor::Group group = d->group; | - | ||||||||||||||||||||||||
| 2165 | - | |||||||||||||||||||||||||
| 2166 | if (args->length() == 0
| 0-284 | ||||||||||||||||||||||||
| 2167 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2168 | - | |||||||||||||||||||||||||
| 2169 | int i = 0; | - | ||||||||||||||||||||||||
| 2170 | QV4::Scope scope(args->v4engine()); | - | ||||||||||||||||||||||||
| 2171 | QV4::ScopedValue v(scope, (*args)[i]); | - | ||||||||||||||||||||||||
| 2172 | if (d->parseIndex(v, &index, &group)
| 72-212 | ||||||||||||||||||||||||
| 2173 | if (index < 0
| 2-210 | ||||||||||||||||||||||||
| 2174 | qmlWarning(this) << tr("insert: index out of range"); | - | ||||||||||||||||||||||||
| 2175 | return; executed 4 times by 1 test: return;Executed by:
| 4 | ||||||||||||||||||||||||
| 2176 | } | - | ||||||||||||||||||||||||
| 2177 | if (++
| 0-208 | ||||||||||||||||||||||||
| 2178 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2179 | v = (*args)[i]; | - | ||||||||||||||||||||||||
| 2180 | } executed 208 times by 1 test: end of blockExecuted by:
| 208 | ||||||||||||||||||||||||
| 2181 | - | |||||||||||||||||||||||||
| 2182 | Compositor::insert_iterator before = index < model->m_compositor.count(group)
| 84-196 | ||||||||||||||||||||||||
| 2183 | ? model->m_compositor.findInsertPosition(group, index) | - | ||||||||||||||||||||||||
| 2184 | : model->m_compositor.end(); | - | ||||||||||||||||||||||||
| 2185 | - | |||||||||||||||||||||||||
| 2186 | int groups = 1 << d->group; | - | ||||||||||||||||||||||||
| 2187 | if (++
| 12-268 | ||||||||||||||||||||||||
| 2188 | QV4::ScopedValue val(scope, (*args)[i]); | - | ||||||||||||||||||||||||
| 2189 | groups |= model->m_cacheMetaType->parseGroups(val); | - | ||||||||||||||||||||||||
| 2190 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||
| 2191 | - | |||||||||||||||||||||||||
| 2192 | if (v->as<QV4::ArrayObject>()
| 0-280 | ||||||||||||||||||||||||
| 2193 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2194 | } else if (v->as<QV4::Object>()
| 0-280 | ||||||||||||||||||||||||
| 2195 | model->insert(before, v, groups); | - | ||||||||||||||||||||||||
| 2196 | model->emitChanges(); | - | ||||||||||||||||||||||||
| 2197 | } executed 280 times by 1 test: end of blockExecuted by:
| 280 | ||||||||||||||||||||||||
| 2198 | } executed 280 times by 1 test: end of blockExecuted by:
| 280 | ||||||||||||||||||||||||
| 2199 | void QQmlDelegateModelGroup::create(QQmlV4Function *args) | - | ||||||||||||||||||||||||
| 2200 | { | - | ||||||||||||||||||||||||
| 2201 | QQmlDelegateModelGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2202 | if (!d->model
| 0-536 | ||||||||||||||||||||||||
| 2203 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2204 | - | |||||||||||||||||||||||||
| 2205 | if (args->length() == 0
| 0-536 | ||||||||||||||||||||||||
| 2206 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2207 | - | |||||||||||||||||||||||||
| 2208 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model); | - | ||||||||||||||||||||||||
| 2209 | - | |||||||||||||||||||||||||
| 2210 | int index = model->m_compositor.count(d->group); | - | ||||||||||||||||||||||||
| 2211 | Compositor::Group group = d->group; | - | ||||||||||||||||||||||||
| 2212 | - | |||||||||||||||||||||||||
| 2213 | int i = 0; | - | ||||||||||||||||||||||||
| 2214 | QV4::Scope scope(args->v4engine()); | - | ||||||||||||||||||||||||
| 2215 | QV4::ScopedValue v(scope, (*args)[i]); | - | ||||||||||||||||||||||||
| 2216 | if (d->parseIndex(v, &index, &group)
| 16-520 | ||||||||||||||||||||||||
| 2217 | ++ executed 520 times by 1 test: i;++i;Executed by:
executed 520 times by 1 test: ++i;Executed by:
| 520 | ||||||||||||||||||||||||
| 2218 | - | |||||||||||||||||||||||||
| 2219 | if (i < args->length()
| 2-396 | ||||||||||||||||||||||||
| 2220 | v = (*args)[i]; | - | ||||||||||||||||||||||||
| 2221 | if (v->as<QV4::Object>()
| 0-136 | ||||||||||||||||||||||||
| 2222 | int groups = 1 << d->group; | - | ||||||||||||||||||||||||
| 2223 | if (++
| 12-124 | ||||||||||||||||||||||||
| 2224 | QV4::ScopedValue val(scope, (*args)[i]); | - | ||||||||||||||||||||||||
| 2225 | groups |= model->m_cacheMetaType->parseGroups(val); | - | ||||||||||||||||||||||||
| 2226 | } executed 12 times by 1 test: end of blockExecuted by:
| 12 | ||||||||||||||||||||||||
| 2227 | - | |||||||||||||||||||||||||
| 2228 | Compositor::insert_iterator before = index < model->m_compositor.count(group)
| 16-120 | ||||||||||||||||||||||||
| 2229 | ? model->m_compositor.findInsertPosition(group, index) | - | ||||||||||||||||||||||||
| 2230 | : model->m_compositor.end(); | - | ||||||||||||||||||||||||
| 2231 | - | |||||||||||||||||||||||||
| 2232 | index = before.index[d->group]; | - | ||||||||||||||||||||||||
| 2233 | group = d->group; | - | ||||||||||||||||||||||||
| 2234 | - | |||||||||||||||||||||||||
| 2235 | if (!model->insert(before, v, groups)
| 0-136 | ||||||||||||||||||||||||
| 2236 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2237 | } | - | ||||||||||||||||||||||||
| 2238 | } executed 136 times by 1 test: end of blockExecuted by:
| 136 | ||||||||||||||||||||||||
| 2239 | } executed 136 times by 1 test: end of blockExecuted by:
| 136 | ||||||||||||||||||||||||
| 2240 | if (index < 0
| 2-534 | ||||||||||||||||||||||||
| 2241 | qmlWarning(this) << tr("create: index out of range"); | - | ||||||||||||||||||||||||
| 2242 | return; executed 4 times by 1 test: return;Executed by:
| 4 | ||||||||||||||||||||||||
| 2243 | } | - | ||||||||||||||||||||||||
| 2244 | - | |||||||||||||||||||||||||
| 2245 | QObject *object = model->object(group, index, QQmlIncubator::AsynchronousIfNested); | - | ||||||||||||||||||||||||
| 2246 | if (object
| 0-532 | ||||||||||||||||||||||||
| 2247 | QVector<Compositor::Insert> inserts; | - | ||||||||||||||||||||||||
| 2248 | Compositor::iterator it = model->m_compositor.find(group, index); | - | ||||||||||||||||||||||||
| 2249 | model->m_compositor.setFlags(it, 1, d->group, Compositor::PersistedFlag, &inserts); | - | ||||||||||||||||||||||||
| 2250 | model->itemsInserted(inserts); | - | ||||||||||||||||||||||||
| 2251 | model->m_cache.at(it.cacheIndex)->releaseObject(); | - | ||||||||||||||||||||||||
| 2252 | } executed 532 times by 1 test: end of blockExecuted by:
| 532 | ||||||||||||||||||||||||
| 2253 | - | |||||||||||||||||||||||||
| 2254 | args->setReturnValue(QV4::QObjectWrapper::wrap(args->v4engine(), object)); | - | ||||||||||||||||||||||||
| 2255 | model->emitChanges(); | - | ||||||||||||||||||||||||
| 2256 | } executed 532 times by 1 test: end of blockExecuted by:
| 532 | ||||||||||||||||||||||||
| 2257 | void QQmlDelegateModelGroup::resolve(QQmlV4Function *args) | - | ||||||||||||||||||||||||
| 2258 | { | - | ||||||||||||||||||||||||
| 2259 | QQmlDelegateModelGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2260 | if (!d->model
| 0-148 | ||||||||||||||||||||||||
| 2261 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2262 | - | |||||||||||||||||||||||||
| 2263 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model); | - | ||||||||||||||||||||||||
| 2264 | - | |||||||||||||||||||||||||
| 2265 | if (args->length() < 2
| 0-148 | ||||||||||||||||||||||||
| 2266 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2267 | - | |||||||||||||||||||||||||
| 2268 | int from = -1; | - | ||||||||||||||||||||||||
| 2269 | int to = -1; | - | ||||||||||||||||||||||||
| 2270 | Compositor::Group fromGroup = d->group; | - | ||||||||||||||||||||||||
| 2271 | Compositor::Group toGroup = d->group; | - | ||||||||||||||||||||||||
| 2272 | - | |||||||||||||||||||||||||
| 2273 | QV4::Scope scope(args->v4engine()); | - | ||||||||||||||||||||||||
| 2274 | QV4::ScopedValue v(scope, (*args)[0]); | - | ||||||||||||||||||||||||
| 2275 | if (d->parseIndex(v, &from, &fromGroup)
| 2-146 | ||||||||||||||||||||||||
| 2276 | if (from < 0
| 2-144 | ||||||||||||||||||||||||
| 2277 | qmlWarning(this) << tr("resolve: from index out of range"); | - | ||||||||||||||||||||||||
| 2278 | return; executed 4 times by 1 test: return;Executed by:
| 4 | ||||||||||||||||||||||||
| 2279 | } | - | ||||||||||||||||||||||||
| 2280 | } executed 142 times by 1 test: else {end of blockExecuted by:
| 142 | ||||||||||||||||||||||||
| 2281 | qmlWarning(this) << tr("resolve: from index invalid"); | - | ||||||||||||||||||||||||
| 2282 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||
| 2283 | } | - | ||||||||||||||||||||||||
| 2284 | - | |||||||||||||||||||||||||
| 2285 | v = (*args)[1]; | - | ||||||||||||||||||||||||
| 2286 | if (d->parseIndex(v, &to, &toGroup)
| 2-140 | ||||||||||||||||||||||||
| 2287 | if (to < 0
| 2-138 | ||||||||||||||||||||||||
| 2288 | qmlWarning(this) << tr("resolve: to index out of range"); | - | ||||||||||||||||||||||||
| 2289 | return; executed 4 times by 1 test: return;Executed by:
| 4 | ||||||||||||||||||||||||
| 2290 | } | - | ||||||||||||||||||||||||
| 2291 | } executed 136 times by 1 test: else {end of blockExecuted by:
| 136 | ||||||||||||||||||||||||
| 2292 | qmlWarning(this) << tr("resolve: to index invalid"); | - | ||||||||||||||||||||||||
| 2293 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||
| 2294 | } | - | ||||||||||||||||||||||||
| 2295 | - | |||||||||||||||||||||||||
| 2296 | Compositor::iterator fromIt = model->m_compositor.find(fromGroup, from); | - | ||||||||||||||||||||||||
| 2297 | Compositor::iterator toIt = model->m_compositor.find(toGroup, to); | - | ||||||||||||||||||||||||
| 2298 | - | |||||||||||||||||||||||||
| 2299 | if (!fromIt->isUnresolved()
| 2-134 | ||||||||||||||||||||||||
| 2300 | qmlWarning(this) << tr("resolve: from is not an unresolved item"); | - | ||||||||||||||||||||||||
| 2301 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||
| 2302 | } | - | ||||||||||||||||||||||||
| 2303 | if (!toIt->list
| 2-132 | ||||||||||||||||||||||||
| 2304 | qmlWarning(this) << tr("resolve: to is not a model item"); | - | ||||||||||||||||||||||||
| 2305 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||
| 2306 | } | - | ||||||||||||||||||||||||
| 2307 | - | |||||||||||||||||||||||||
| 2308 | const int unresolvedFlags = fromIt->flags; | - | ||||||||||||||||||||||||
| 2309 | const int resolvedFlags = toIt->flags; | - | ||||||||||||||||||||||||
| 2310 | const int resolvedIndex = toIt.modelIndex(); | - | ||||||||||||||||||||||||
| 2311 | void * const resolvedList = toIt->list; | - | ||||||||||||||||||||||||
| 2312 | - | |||||||||||||||||||||||||
| 2313 | QQmlDelegateModelItem *cacheItem = model->m_cache.at(fromIt.cacheIndex); | - | ||||||||||||||||||||||||
| 2314 | cacheItem->groups &= ~Compositor::UnresolvedFlag; | - | ||||||||||||||||||||||||
| 2315 | - | |||||||||||||||||||||||||
| 2316 | if (toIt.cacheIndex > fromIt.cacheIndex
| 64-68 | ||||||||||||||||||||||||
| 2317 | toIt.decrementIndexes(1, unresolvedFlags); executed 68 times by 1 test: toIt.decrementIndexes(1, unresolvedFlags);Executed by:
| 68 | ||||||||||||||||||||||||
| 2318 | if (!toIt->inGroup(fromGroup)
| 0-132 | ||||||||||||||||||||||||
| 2319 | from += 1; executed 12 times by 1 test: from += 1;Executed by:
| 12 | ||||||||||||||||||||||||
| 2320 | - | |||||||||||||||||||||||||
| 2321 | model->itemsMoved( | - | ||||||||||||||||||||||||
| 2322 | QVector<Compositor::Remove>(1, Compositor::Remove(fromIt, 1, unresolvedFlags, 0)), | - | ||||||||||||||||||||||||
| 2323 | QVector<Compositor::Insert>(1, Compositor::Insert(toIt, 1, unresolvedFlags, 0))); | - | ||||||||||||||||||||||||
| 2324 | model->itemsInserted( | - | ||||||||||||||||||||||||
| 2325 | QVector<Compositor::Insert>(1, Compositor::Insert(toIt, 1, (resolvedFlags & ~unresolvedFlags) | Compositor::CacheFlag))); | - | ||||||||||||||||||||||||
| 2326 | toIt.incrementIndexes(1, resolvedFlags | unresolvedFlags); | - | ||||||||||||||||||||||||
| 2327 | model->itemsRemoved(QVector<Compositor::Remove>(1, Compositor::Remove(toIt, 1, resolvedFlags))); | - | ||||||||||||||||||||||||
| 2328 | - | |||||||||||||||||||||||||
| 2329 | model->m_compositor.setFlags(toGroup, to, 1, unresolvedFlags & ~Compositor::UnresolvedFlag); | - | ||||||||||||||||||||||||
| 2330 | model->m_compositor.clearFlags(fromGroup, from, 1, unresolvedFlags); | - | ||||||||||||||||||||||||
| 2331 | - | |||||||||||||||||||||||||
| 2332 | if (resolvedFlags & Compositor::CacheFlag
| 60-72 | ||||||||||||||||||||||||
| 2333 | model->m_compositor.insert(Compositor::Cache, toIt.cacheIndex, resolvedList, resolvedIndex, 1, Compositor::CacheFlag); executed 72 times by 1 test: model->m_compositor.insert(Compositor::Cache, toIt.cacheIndex, resolvedList, resolvedIndex, 1, Compositor::CacheFlag);Executed by:
| 72 | ||||||||||||||||||||||||
| 2334 | - | |||||||||||||||||||||||||
| 2335 | ((model->m_cache.count() == model->m_compositor.count(Compositor::Cache)) ? static_cast<void>(0) : qt_assert("model->m_cache.count() == model->m_compositor.count(Compositor::Cache)", __FILE__, 2833)); | - | ||||||||||||||||||||||||
| 2336 | - | |||||||||||||||||||||||||
| 2337 | if (!cacheItem->isReferenced()
| 0-132 | ||||||||||||||||||||||||
| 2338 | ((toIt.cacheIndex == model->m_cache.indexOf(cacheItem)) ? static_cast<void>(0) : qt_assert("toIt.cacheIndex == model->m_cache.indexOf(cacheItem)", __FILE__, 2836)); | - | ||||||||||||||||||||||||
| 2339 | model->m_cache.removeAt(toIt.cacheIndex); | - | ||||||||||||||||||||||||
| 2340 | model->m_compositor.clearFlags(Compositor::Cache, toIt.cacheIndex, 1, Compositor::CacheFlag); | - | ||||||||||||||||||||||||
| 2341 | delete cacheItem; | - | ||||||||||||||||||||||||
| 2342 | ((model->m_cache.count() == model->m_compositor.count(Compositor::Cache)) ? static_cast<void>(0) : qt_assert("model->m_cache.count() == model->m_compositor.count(Compositor::Cache)", __FILE__, 2840)); | - | ||||||||||||||||||||||||
| 2343 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2344 | cacheItem->resolveIndex(model->m_adaptorModel, resolvedIndex); | - | ||||||||||||||||||||||||
| 2345 | if (cacheItem->attached
| 0-132 | ||||||||||||||||||||||||
| 2346 | cacheItem->attached->emitUnresolvedChanged(); never executed: cacheItem->attached->emitUnresolvedChanged(); | 0 | ||||||||||||||||||||||||
| 2347 | } executed 132 times by 1 test: end of blockExecuted by:
| 132 | ||||||||||||||||||||||||
| 2348 | - | |||||||||||||||||||||||||
| 2349 | model->emitChanges(); | - | ||||||||||||||||||||||||
| 2350 | } executed 132 times by 1 test: end of blockExecuted by:
| 132 | ||||||||||||||||||||||||
| 2351 | - | |||||||||||||||||||||||||
| 2352 | - | |||||||||||||||||||||||||
| 2353 | - | |||||||||||||||||||||||||
| 2354 | - | |||||||||||||||||||||||||
| 2355 | - | |||||||||||||||||||||||||
| 2356 | - | |||||||||||||||||||||||||
| 2357 | - | |||||||||||||||||||||||||
| 2358 | void QQmlDelegateModelGroup::remove(QQmlV4Function *args) | - | ||||||||||||||||||||||||
| 2359 | { | - | ||||||||||||||||||||||||
| 2360 | QQmlDelegateModelGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2361 | if (!d->model
| 0-44 | ||||||||||||||||||||||||
| 2362 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2363 | Compositor::Group group = d->group; | - | ||||||||||||||||||||||||
| 2364 | int index = -1; | - | ||||||||||||||||||||||||
| 2365 | int count = 1; | - | ||||||||||||||||||||||||
| 2366 | - | |||||||||||||||||||||||||
| 2367 | if (args->length() == 0
| 0-44 | ||||||||||||||||||||||||
| 2368 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2369 | - | |||||||||||||||||||||||||
| 2370 | int i = 0; | - | ||||||||||||||||||||||||
| 2371 | QV4::Scope scope(args->v4engine()); | - | ||||||||||||||||||||||||
| 2372 | QV4::ScopedValue v(scope, (*args)[0]); | - | ||||||||||||||||||||||||
| 2373 | if (!d->parseIndex(v, &index, &group)
| 2-42 | ||||||||||||||||||||||||
| 2374 | qmlWarning(this) << tr("remove: invalid index"); | - | ||||||||||||||||||||||||
| 2375 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||
| 2376 | } | - | ||||||||||||||||||||||||
| 2377 | - | |||||||||||||||||||||||||
| 2378 | if (++
| 6-36 | ||||||||||||||||||||||||
| 2379 | v = (*args)[i]; | - | ||||||||||||||||||||||||
| 2380 | if (v->isNumber()
| 0-36 | ||||||||||||||||||||||||
| 2381 | count = v->toInt32(); executed 36 times by 1 test: count = v->toInt32();Executed by:
| 36 | ||||||||||||||||||||||||
| 2382 | } executed 36 times by 1 test: end of blockExecuted by:
| 36 | ||||||||||||||||||||||||
| 2383 | - | |||||||||||||||||||||||||
| 2384 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model); | - | ||||||||||||||||||||||||
| 2385 | if (index < 0
| 6-36 | ||||||||||||||||||||||||
| 2386 | qmlWarning(this) << tr("remove: index out of range"); | - | ||||||||||||||||||||||||
| 2387 | } executed 16 times by 1 test: else if (count != 0end of blockExecuted by:
| 0-26 | ||||||||||||||||||||||||
| 2388 | Compositor::iterator it = model->m_compositor.find(group, index); | - | ||||||||||||||||||||||||
| 2389 | if (count < 0
| 6-20 | ||||||||||||||||||||||||
| 2390 | qmlWarning(this) << tr("remove: invalid count"); | - | ||||||||||||||||||||||||
| 2391 | } executed 12 times by 1 test: else {end of blockExecuted by:
| 12 | ||||||||||||||||||||||||
| 2392 | model->removeGroups(it, count, d->group, 1 << d->group); | - | ||||||||||||||||||||||||
| 2393 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||
| 2394 | } | - | ||||||||||||||||||||||||
| 2395 | } executed 42 times by 1 test: end of blockExecuted by:
| 42 | ||||||||||||||||||||||||
| 2396 | - | |||||||||||||||||||||||||
| 2397 | bool QQmlDelegateModelGroupPrivate::parseGroupArgs( | - | ||||||||||||||||||||||||
| 2398 | QQmlV4Function *args, Compositor::Group *group, int *index, int *count, int *groups) const | - | ||||||||||||||||||||||||
| 2399 | { | - | ||||||||||||||||||||||||
| 2400 | if (!model
| 0-124 | ||||||||||||||||||||||||
| 2401 | return executed 10 times by 2 tests: false;return false;Executed by:
executed 10 times by 2 tests: return false;Executed by:
| 10 | ||||||||||||||||||||||||
| 2402 | - | |||||||||||||||||||||||||
| 2403 | if (args->length() < 2
| 0-114 | ||||||||||||||||||||||||
| 2404 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2405 | - | |||||||||||||||||||||||||
| 2406 | int i = 0; | - | ||||||||||||||||||||||||
| 2407 | QV4::Scope scope(args->v4engine()); | - | ||||||||||||||||||||||||
| 2408 | QV4::ScopedValue v(scope, (*args)[i]); | - | ||||||||||||||||||||||||
| 2409 | if (!parseIndex(v, index, group)
| 0-114 | ||||||||||||||||||||||||
| 2410 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2411 | - | |||||||||||||||||||||||||
| 2412 | v = (*args)[++i]; | - | ||||||||||||||||||||||||
| 2413 | if (v->isNumber()
| 20-94 | ||||||||||||||||||||||||
| 2414 | *count = v->toInt32(); | - | ||||||||||||||||||||||||
| 2415 | - | |||||||||||||||||||||||||
| 2416 | if (++
| 0-94 | ||||||||||||||||||||||||
| 2417 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||||||||
| 2418 | v = (*args)[i]; | - | ||||||||||||||||||||||||
| 2419 | } executed 94 times by 1 test: end of blockExecuted by:
| 94 | ||||||||||||||||||||||||
| 2420 | - | |||||||||||||||||||||||||
| 2421 | *groups = QQmlDelegateModelPrivate::get(model)->m_cacheMetaType->parseGroups(v); | - | ||||||||||||||||||||||||
| 2422 | - | |||||||||||||||||||||||||
| 2423 | return executed 114 times by 1 test: true;return true;Executed by:
executed 114 times by 1 test: return true;Executed by:
| 114 | ||||||||||||||||||||||||
| 2424 | } | - | ||||||||||||||||||||||||
| 2425 | - | |||||||||||||||||||||||||
| 2426 | - | |||||||||||||||||||||||||
| 2427 | - | |||||||||||||||||||||||||
| 2428 | - | |||||||||||||||||||||||||
| 2429 | - | |||||||||||||||||||||||||
| 2430 | - | |||||||||||||||||||||||||
| 2431 | - | |||||||||||||||||||||||||
| 2432 | void QQmlDelegateModelGroup::addGroups(QQmlV4Function *args) | - | ||||||||||||||||||||||||
| 2433 | { | - | ||||||||||||||||||||||||
| 2434 | QQmlDelegateModelGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2435 | Compositor::Group group = d->group; | - | ||||||||||||||||||||||||
| 2436 | int index = -1; | - | ||||||||||||||||||||||||
| 2437 | int count = 1; | - | ||||||||||||||||||||||||
| 2438 | int groups = 0; | - | ||||||||||||||||||||||||
| 2439 | - | |||||||||||||||||||||||||
| 2440 | if (!d->parseGroupArgs(args, &group, &index, &count, &groups)
| 2-42 | ||||||||||||||||||||||||
| 2441 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||
| 2442 | - | |||||||||||||||||||||||||
| 2443 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model); | - | ||||||||||||||||||||||||
| 2444 | if (index < 0
| 6-36 | ||||||||||||||||||||||||
| 2445 | qmlWarning(this) << tr("addGroups: index out of range"); | - | ||||||||||||||||||||||||
| 2446 | } executed 14 times by 1 test: else if (count != 0end of blockExecuted by:
| 0-28 | ||||||||||||||||||||||||
| 2447 | Compositor::iterator it = model->m_compositor.find(group, index); | - | ||||||||||||||||||||||||
| 2448 | if (count < 0
| 6-22 | ||||||||||||||||||||||||
| 2449 | qmlWarning(this) << tr("addGroups: invalid count"); | - | ||||||||||||||||||||||||
| 2450 | } executed 12 times by 1 test: else {end of blockExecuted by:
| 12 | ||||||||||||||||||||||||
| 2451 | model->addGroups(it, count, d->group, groups); | - | ||||||||||||||||||||||||
| 2452 | } executed 16 times by 1 test: end of blockExecuted by:
| 16 | ||||||||||||||||||||||||
| 2453 | } | - | ||||||||||||||||||||||||
| 2454 | } executed 42 times by 1 test: end of blockExecuted by:
| 42 | ||||||||||||||||||||||||
| 2455 | - | |||||||||||||||||||||||||
| 2456 | - | |||||||||||||||||||||||||
| 2457 | - | |||||||||||||||||||||||||
| 2458 | - | |||||||||||||||||||||||||
| 2459 | - | |||||||||||||||||||||||||
| 2460 | - | |||||||||||||||||||||||||
| 2461 | - | |||||||||||||||||||||||||
| 2462 | void QQmlDelegateModelGroup::removeGroups(QQmlV4Function *args) | - | ||||||||||||||||||||||||
| 2463 | { | - | ||||||||||||||||||||||||
| 2464 | QQmlDelegateModelGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2465 | Compositor::Group group = d->group; | - | ||||||||||||||||||||||||
| 2466 | int index = -1; | - | ||||||||||||||||||||||||
| 2467 | int count = 1; | - | ||||||||||||||||||||||||
| 2468 | int groups = 0; | - | ||||||||||||||||||||||||
| 2469 | - | |||||||||||||||||||||||||
| 2470 | if (!d->parseGroupArgs(args, &group, &index, &count, &groups)
| 2-32 | ||||||||||||||||||||||||
| 2471 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||
| 2472 | - | |||||||||||||||||||||||||
| 2473 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model); | - | ||||||||||||||||||||||||
| 2474 | if (index < 0
| 6-26 | ||||||||||||||||||||||||
| 2475 | qmlWarning(this) << tr("removeGroups: index out of range"); | - | ||||||||||||||||||||||||
| 2476 | } executed 14 times by 1 test: else if (count != 0end of blockExecuted by:
| 0-18 | ||||||||||||||||||||||||
| 2477 | Compositor::iterator it = model->m_compositor.find(group, index); | - | ||||||||||||||||||||||||
| 2478 | if (count < 0
| 6-12 | ||||||||||||||||||||||||
| 2479 | qmlWarning(this) << tr("removeGroups: invalid count"); | - | ||||||||||||||||||||||||
| 2480 | } executed 12 times by 1 test: else {end of blockExecuted by:
| 12 | ||||||||||||||||||||||||
| 2481 | model->removeGroups(it, count, d->group, groups); | - | ||||||||||||||||||||||||
| 2482 | } executed 6 times by 1 test: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 2483 | } | - | ||||||||||||||||||||||||
| 2484 | } executed 32 times by 1 test: end of blockExecuted by:
| 32 | ||||||||||||||||||||||||
| 2485 | - | |||||||||||||||||||||||||
| 2486 | - | |||||||||||||||||||||||||
| 2487 | - | |||||||||||||||||||||||||
| 2488 | - | |||||||||||||||||||||||||
| 2489 | - | |||||||||||||||||||||||||
| 2490 | - | |||||||||||||||||||||||||
| 2491 | - | |||||||||||||||||||||||||
| 2492 | void QQmlDelegateModelGroup::setGroups(QQmlV4Function *args) | - | ||||||||||||||||||||||||
| 2493 | { | - | ||||||||||||||||||||||||
| 2494 | QQmlDelegateModelGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2495 | Compositor::Group group = d->group; | - | ||||||||||||||||||||||||
| 2496 | int index = -1; | - | ||||||||||||||||||||||||
| 2497 | int count = 1; | - | ||||||||||||||||||||||||
| 2498 | int groups = 0; | - | ||||||||||||||||||||||||
| 2499 | - | |||||||||||||||||||||||||
| 2500 | if (!d->parseGroupArgs(args, &group, &index, &count, &groups)
| 6-40 | ||||||||||||||||||||||||
| 2501 | return; executed 6 times by 2 tests: return;Executed by:
| 6 | ||||||||||||||||||||||||
| 2502 | - | |||||||||||||||||||||||||
| 2503 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model); | - | ||||||||||||||||||||||||
| 2504 | if (index < 0
| 6-34 | ||||||||||||||||||||||||
| 2505 | qmlWarning(this) << tr("setGroups: index out of range"); | - | ||||||||||||||||||||||||
| 2506 | } executed 14 times by 1 test: else if (count != 0end of blockExecuted by:
| 0-26 | ||||||||||||||||||||||||
| 2507 | Compositor::iterator it = model->m_compositor.find(group, index); | - | ||||||||||||||||||||||||
| 2508 | if (count < 0
| 6-20 | ||||||||||||||||||||||||
| 2509 | qmlWarning(this) << tr("setGroups: invalid count"); | - | ||||||||||||||||||||||||
| 2510 | } executed 12 times by 1 test: else {end of blockExecuted by:
| 12 | ||||||||||||||||||||||||
| 2511 | model->setGroups(it, count, d->group, groups); | - | ||||||||||||||||||||||||
| 2512 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||
| 2513 | } | - | ||||||||||||||||||||||||
| 2514 | } executed 40 times by 1 test: end of blockExecuted by:
| 40 | ||||||||||||||||||||||||
| 2515 | void QQmlDelegateModelGroup::move(QQmlV4Function *args) | - | ||||||||||||||||||||||||
| 2516 | { | - | ||||||||||||||||||||||||
| 2517 | QQmlDelegateModelGroupPrivate * const d = d_func(); | - | ||||||||||||||||||||||||
| 2518 | - | |||||||||||||||||||||||||
| 2519 | if (args->length() < 2
| 0-90 | ||||||||||||||||||||||||
| 2520 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2521 | - | |||||||||||||||||||||||||
| 2522 | Compositor::Group fromGroup = d->group; | - | ||||||||||||||||||||||||
| 2523 | Compositor::Group toGroup = d->group; | - | ||||||||||||||||||||||||
| 2524 | int from = -1; | - | ||||||||||||||||||||||||
| 2525 | int to = -1; | - | ||||||||||||||||||||||||
| 2526 | int count = 1; | - | ||||||||||||||||||||||||
| 2527 | - | |||||||||||||||||||||||||
| 2528 | QV4::Scope scope(args->v4engine()); | - | ||||||||||||||||||||||||
| 2529 | QV4::ScopedValue v(scope, (*args)[0]); | - | ||||||||||||||||||||||||
| 2530 | if (!d->parseIndex(v, &from, &fromGroup)
| 2-88 | ||||||||||||||||||||||||
| 2531 | qmlWarning(this) << tr("move: invalid from index"); | - | ||||||||||||||||||||||||
| 2532 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||
| 2533 | } | - | ||||||||||||||||||||||||
| 2534 | - | |||||||||||||||||||||||||
| 2535 | v = (*args)[1]; | - | ||||||||||||||||||||||||
| 2536 | if (!d->parseIndex(v, &to, &toGroup)
| 2-86 | ||||||||||||||||||||||||
| 2537 | qmlWarning(this) << tr("move: invalid to index"); | - | ||||||||||||||||||||||||
| 2538 | return; executed 2 times by 1 test: return;Executed by:
| 2 | ||||||||||||||||||||||||
| 2539 | } | - | ||||||||||||||||||||||||
| 2540 | - | |||||||||||||||||||||||||
| 2541 | if (args->length() > 2
| 30-56 | ||||||||||||||||||||||||
| 2542 | v = (*args)[2]; | - | ||||||||||||||||||||||||
| 2543 | if (v->isNumber()
| 0-56 | ||||||||||||||||||||||||
| 2544 | count = v->toInt32(); executed 56 times by 1 test: count = v->toInt32();Executed by:
| 56 | ||||||||||||||||||||||||
| 2545 | } executed 56 times by 1 test: end of blockExecuted by:
| 56 | ||||||||||||||||||||||||
| 2546 | - | |||||||||||||||||||||||||
| 2547 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(d->model); | - | ||||||||||||||||||||||||
| 2548 | - | |||||||||||||||||||||||||
| 2549 | if (count < 0
| 6-80 | ||||||||||||||||||||||||
| 2550 | qmlWarning(this) << tr("move: invalid count"); | - | ||||||||||||||||||||||||
| 2551 | } executed 6 times by 1 test: else if (from < 0end of blockExecuted by:
| 6-74 | ||||||||||||||||||||||||
| 2552 | qmlWarning(this) << tr("move: from index out of range"); | - | ||||||||||||||||||||||||
| 2553 | } executed 20 times by 1 test: else if (!model->m_compositor.verifyMoveTo(fromGroup, from, toGroup, to, count, d->group)end of blockExecuted by:
| 18-42 | ||||||||||||||||||||||||
| 2554 | qmlWarning(this) << tr("move: to index out of range"); | - | ||||||||||||||||||||||||
| 2555 | } executed 18 times by 1 test: else if (count > 0end of blockExecuted by:
| 0-42 | ||||||||||||||||||||||||
| 2556 | QVector<Compositor::Remove> removes; | - | ||||||||||||||||||||||||
| 2557 | QVector<Compositor::Insert> inserts; | - | ||||||||||||||||||||||||
| 2558 | - | |||||||||||||||||||||||||
| 2559 | model->m_compositor.move(fromGroup, from, toGroup, to, count, d->group, &removes, &inserts); | - | ||||||||||||||||||||||||
| 2560 | model->itemsMoved(removes, inserts); | - | ||||||||||||||||||||||||
| 2561 | model->emitChanges(); | - | ||||||||||||||||||||||||
| 2562 | } executed 42 times by 3 tests: end of blockExecuted by:
| 42 | ||||||||||||||||||||||||
| 2563 | - | |||||||||||||||||||||||||
| 2564 | } executed 86 times by 3 tests: end of blockExecuted by:
| 86 | ||||||||||||||||||||||||
| 2565 | QQmlPartsModel::QQmlPartsModel(QQmlDelegateModel *model, const QString &part, QObject *parent) | - | ||||||||||||||||||||||||
| 2566 | : QQmlInstanceModel(*new QObjectPrivate, parent) | - | ||||||||||||||||||||||||
| 2567 | , m_model(model) | - | ||||||||||||||||||||||||
| 2568 | , m_part(part) | - | ||||||||||||||||||||||||
| 2569 | , m_compositorGroup(Compositor::Cache) | - | ||||||||||||||||||||||||
| 2570 | , m_inheritGroup(true) | - | ||||||||||||||||||||||||
| 2571 | { | - | ||||||||||||||||||||||||
| 2572 | QQmlDelegateModelPrivate *d = QQmlDelegateModelPrivate::get(m_model); | - | ||||||||||||||||||||||||
| 2573 | if (d->m_cacheMetaType
| 0-368 | ||||||||||||||||||||||||
| 2574 | QQmlDelegateModelGroupPrivate::get(d->m_groups[1])->emitters.insert(this); | - | ||||||||||||||||||||||||
| 2575 | m_compositorGroup = Compositor::Default; | - | ||||||||||||||||||||||||
| 2576 | } never executed: else {end of block | 0 | ||||||||||||||||||||||||
| 2577 | d->m_pendingParts.insert(this); | - | ||||||||||||||||||||||||
| 2578 | } executed 368 times by 6 tests: end of blockExecuted by:
| 368 | ||||||||||||||||||||||||
| 2579 | } | - | ||||||||||||||||||||||||
| 2580 | - | |||||||||||||||||||||||||
| 2581 | QQmlPartsModel::~QQmlPartsModel() | - | ||||||||||||||||||||||||
| 2582 | { | - | ||||||||||||||||||||||||
| 2583 | } | - | ||||||||||||||||||||||||
| 2584 | - | |||||||||||||||||||||||||
| 2585 | QString QQmlPartsModel::filterGroup() const | - | ||||||||||||||||||||||||
| 2586 | { | - | ||||||||||||||||||||||||
| 2587 | if (m_inheritGroup
| 2-4 | ||||||||||||||||||||||||
| 2588 | return executed 2 times by 1 test: m_model->filterGroup();return m_model->filterGroup();Executed by:
executed 2 times by 1 test: return m_model->filterGroup();Executed by:
| 2 | ||||||||||||||||||||||||
| 2589 | return executed 4 times by 1 test: m_filterGroup;return m_filterGroup;Executed by:
executed 4 times by 1 test: return m_filterGroup;Executed by:
| 4 | ||||||||||||||||||||||||
| 2590 | } | - | ||||||||||||||||||||||||
| 2591 | - | |||||||||||||||||||||||||
| 2592 | void QQmlPartsModel::setFilterGroup(const QString &group) | - | ||||||||||||||||||||||||
| 2593 | { | - | ||||||||||||||||||||||||
| 2594 | if (QQmlDelegateModelPrivate::get(m_model)->m_transaction
| 0-6 | ||||||||||||||||||||||||
| 2595 | qmlWarning(this) << tr("The group of a DelegateModel cannot be changed within onChanged"); | - | ||||||||||||||||||||||||
| 2596 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2597 | } | - | ||||||||||||||||||||||||
| 2598 | - | |||||||||||||||||||||||||
| 2599 | if (m_filterGroup != group
| 0-6 | ||||||||||||||||||||||||
| 2600 | m_filterGroup = group; | - | ||||||||||||||||||||||||
| 2601 | m_inheritGroup = false; | - | ||||||||||||||||||||||||
| 2602 | updateFilterGroup(); | - | ||||||||||||||||||||||||
| 2603 | - | |||||||||||||||||||||||||
| 2604 | filterGroupChanged(); | - | ||||||||||||||||||||||||
| 2605 | } executed 6 times by 2 tests: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 2606 | } executed 6 times by 2 tests: end of blockExecuted by:
| 6 | ||||||||||||||||||||||||
| 2607 | - | |||||||||||||||||||||||||
| 2608 | void QQmlPartsModel::resetFilterGroup() | - | ||||||||||||||||||||||||
| 2609 | { | - | ||||||||||||||||||||||||
| 2610 | if (!m_inheritGroup
| 0-2 | ||||||||||||||||||||||||
| 2611 | m_inheritGroup = true; | - | ||||||||||||||||||||||||
| 2612 | updateFilterGroup(); | - | ||||||||||||||||||||||||
| 2613 | filterGroupChanged(); | - | ||||||||||||||||||||||||
| 2614 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 2615 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 2616 | - | |||||||||||||||||||||||||
| 2617 | void QQmlPartsModel::updateFilterGroup() | - | ||||||||||||||||||||||||
| 2618 | { | - | ||||||||||||||||||||||||
| 2619 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_model); | - | ||||||||||||||||||||||||
| 2620 | if (!model->m_cacheMetaType
| 0-8 | ||||||||||||||||||||||||
| 2621 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2622 | - | |||||||||||||||||||||||||
| 2623 | if (m_inheritGroup
| 2-6 | ||||||||||||||||||||||||
| 2624 | if (m_filterGroup == model->m_filterGroup
| 0-2 | ||||||||||||||||||||||||
| 2625 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2626 | m_filterGroup = model->m_filterGroup; | - | ||||||||||||||||||||||||
| 2627 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 2628 | - | |||||||||||||||||||||||||
| 2629 | QQmlListCompositor::Group previousGroup = m_compositorGroup; | - | ||||||||||||||||||||||||
| 2630 | m_compositorGroup = Compositor::Default; | - | ||||||||||||||||||||||||
| 2631 | QQmlDelegateModelGroupPrivate::get(model->m_groups[Compositor::Default])->emitters.insert(this); | - | ||||||||||||||||||||||||
| 2632 | for (int i = 1; i < model->m_groupCount
| 0-22 | ||||||||||||||||||||||||
| 2633 | if (m_filterGroup == model->m_cacheMetaType->groupNames.at(i - 1)
| 8-14 | ||||||||||||||||||||||||
| 2634 | m_compositorGroup = Compositor::Group(i); | - | ||||||||||||||||||||||||
| 2635 | break; executed 8 times by 2 tests: break;Executed by:
| 8 | ||||||||||||||||||||||||
| 2636 | } | - | ||||||||||||||||||||||||
| 2637 | } executed 14 times by 2 tests: end of blockExecuted by:
| 14 | ||||||||||||||||||||||||
| 2638 | - | |||||||||||||||||||||||||
| 2639 | QQmlDelegateModelGroupPrivate::get(model->m_groups[m_compositorGroup])->emitters.insert(this); | - | ||||||||||||||||||||||||
| 2640 | if (m_compositorGroup != previousGroup
| 0-8 | ||||||||||||||||||||||||
| 2641 | QVector<QQmlChangeSet::Change> removes; | - | ||||||||||||||||||||||||
| 2642 | QVector<QQmlChangeSet::Change> inserts; | - | ||||||||||||||||||||||||
| 2643 | model->m_compositor.transition(previousGroup, m_compositorGroup, &removes, &inserts); | - | ||||||||||||||||||||||||
| 2644 | - | |||||||||||||||||||||||||
| 2645 | QQmlChangeSet changeSet; | - | ||||||||||||||||||||||||
| 2646 | changeSet.move(removes, inserts); | - | ||||||||||||||||||||||||
| 2647 | if (!changeSet.isEmpty()
| 0-8 | ||||||||||||||||||||||||
| 2648 | modelUpdated(changeSet, false); executed 8 times by 2 tests: modelUpdated(changeSet, false);Executed by:
| 8 | ||||||||||||||||||||||||
| 2649 | - | |||||||||||||||||||||||||
| 2650 | if (changeSet.difference() != 0
| 0-8 | ||||||||||||||||||||||||
| 2651 | countChanged(); executed 8 times by 2 tests: countChanged();Executed by:
| 8 | ||||||||||||||||||||||||
| 2652 | } executed 8 times by 2 tests: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 2653 | } executed 8 times by 2 tests: end of blockExecuted by:
| 8 | ||||||||||||||||||||||||
| 2654 | - | |||||||||||||||||||||||||
| 2655 | void QQmlPartsModel::updateFilterGroup( | - | ||||||||||||||||||||||||
| 2656 | Compositor::Group group, const QQmlChangeSet &changeSet) | - | ||||||||||||||||||||||||
| 2657 | { | - | ||||||||||||||||||||||||
| 2658 | if (!m_inheritGroup
| 0-368 | ||||||||||||||||||||||||
| 2659 | return; never executed: return; | 0 | ||||||||||||||||||||||||
| 2660 | - | |||||||||||||||||||||||||
| 2661 | m_compositorGroup = group; | - | ||||||||||||||||||||||||
| 2662 | QQmlDelegateModelGroupPrivate::get(QQmlDelegateModelPrivate::get(m_model)->m_groups[m_compositorGroup])->emitters.insert(this); | - | ||||||||||||||||||||||||
| 2663 | - | |||||||||||||||||||||||||
| 2664 | if (!changeSet.isEmpty()
| 0-368 | ||||||||||||||||||||||||
| 2665 | modelUpdated(changeSet, false); never executed: modelUpdated(changeSet, false); | 0 | ||||||||||||||||||||||||
| 2666 | - | |||||||||||||||||||||||||
| 2667 | if (changeSet.difference() != 0
| 0-368 | ||||||||||||||||||||||||
| 2668 | countChanged(); never executed: countChanged(); | 0 | ||||||||||||||||||||||||
| 2669 | - | |||||||||||||||||||||||||
| 2670 | filterGroupChanged(); | - | ||||||||||||||||||||||||
| 2671 | } executed 368 times by 6 tests: end of blockExecuted by:
| 368 | ||||||||||||||||||||||||
| 2672 | - | |||||||||||||||||||||||||
| 2673 | int QQmlPartsModel::count() const | - | ||||||||||||||||||||||||
| 2674 | { | - | ||||||||||||||||||||||||
| 2675 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_model); | - | ||||||||||||||||||||||||
| 2676 | return executed 26425 times by 6 tests: model->m_delegatereturn model->m_delegate ? model->m_compositor.count(m_compositorGroup) : 0;Executed by:
executed 26425 times by 6 tests: return model->m_delegate ? model->m_compositor.count(m_compositorGroup) : 0;Executed by:
| 26425 | ||||||||||||||||||||||||
| 2677 | ? model->m_compositor.count(m_compositorGroup) executed 26425 times by 6 tests: return model->m_delegate ? model->m_compositor.count(m_compositorGroup) : 0;Executed by:
| 26425 | ||||||||||||||||||||||||
| 2678 | : 0; executed 26425 times by 6 tests: return model->m_delegate ? model->m_compositor.count(m_compositorGroup) : 0;Executed by:
| 26425 | ||||||||||||||||||||||||
| 2679 | } | - | ||||||||||||||||||||||||
| 2680 | - | |||||||||||||||||||||||||
| 2681 | bool QQmlPartsModel::isValid() const | - | ||||||||||||||||||||||||
| 2682 | { | - | ||||||||||||||||||||||||
| 2683 | return executed 4899 times by 6 tests: m_model->isValid();return m_model->isValid();Executed by:
executed 4899 times by 6 tests: return m_model->isValid();Executed by:
| 4899 | ||||||||||||||||||||||||
| 2684 | } | - | ||||||||||||||||||||||||
| 2685 | - | |||||||||||||||||||||||||
| 2686 | QObject *QQmlPartsModel::object(int index, QQmlIncubator::IncubationMode incubationMode) | - | ||||||||||||||||||||||||
| 2687 | { | - | ||||||||||||||||||||||||
| 2688 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_model); | - | ||||||||||||||||||||||||
| 2689 | - | |||||||||||||||||||||||||
| 2690 | if (!model->m_delegate
| 0-5744 | ||||||||||||||||||||||||
| 2691 | QMessageLogger(__FILE__, 3219, __PRETTY_FUNCTION__).warning() << "DelegateModel::item: index out range" << index << model->m_compositor.count(m_compositorGroup); | - | ||||||||||||||||||||||||
| 2692 | return never executed: nullptr;return nullptr;never executed: return nullptr; | 0 | ||||||||||||||||||||||||
| 2693 | } | - | ||||||||||||||||||||||||
| 2694 | - | |||||||||||||||||||||||||
| 2695 | QObject *object = model->object(m_compositorGroup, index, incubationMode); | - | ||||||||||||||||||||||||
| 2696 | - | |||||||||||||||||||||||||
| 2697 | if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(object)
| 2-5742 | ||||||||||||||||||||||||
| 2698 | QObject *part = package->part(m_part); | - | ||||||||||||||||||||||||
| 2699 | if (!part
| 0-5742 | ||||||||||||||||||||||||
| 2700 | return never executed: nullptr;return nullptr;never executed: return nullptr; | 0 | ||||||||||||||||||||||||
| 2701 | m_packaged.insertMulti(part, package); | - | ||||||||||||||||||||||||
| 2702 | return executed 5742 times by 6 tests: part;return part;Executed by:
executed 5742 times by 6 tests: return part;Executed by:
| 5742 | ||||||||||||||||||||||||
| 2703 | } | - | ||||||||||||||||||||||||
| 2704 | - | |||||||||||||||||||||||||
| 2705 | model->release(object); | - | ||||||||||||||||||||||||
| 2706 | if (!model->m_delegateValidated
| 0-2 | ||||||||||||||||||||||||
| 2707 | if (object
| 0-2 | ||||||||||||||||||||||||
| 2708 | qmlWarning(model->m_delegate) << tr("Delegate component must be Package type."); never executed: qmlWarning(model->m_delegate) << tr("Delegate component must be Package type."); | 0 | ||||||||||||||||||||||||
| 2709 | model->m_delegateValidated = true; | - | ||||||||||||||||||||||||
| 2710 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 2711 | - | |||||||||||||||||||||||||
| 2712 | return executed 2 times by 1 test: nullptr;return nullptr;Executed by:
executed 2 times by 1 test: return nullptr;Executed by:
| 2 | ||||||||||||||||||||||||
| 2713 | } | - | ||||||||||||||||||||||||
| 2714 | - | |||||||||||||||||||||||||
| 2715 | QQmlInstanceModel::ReleaseFlags QQmlPartsModel::release(QObject *item) | - | ||||||||||||||||||||||||
| 2716 | { | - | ||||||||||||||||||||||||
| 2717 | QQmlInstanceModel::ReleaseFlags flags = nullptr; | - | ||||||||||||||||||||||||
| 2718 | - | |||||||||||||||||||||||||
| 2719 | QHash<QObject *, QQuickPackage *>::iterator it = m_packaged.find(item); | - | ||||||||||||||||||||||||
| 2720 | if (it != m_packaged.end()
| 0-3302 | ||||||||||||||||||||||||
| 2721 | QQuickPackage *package = *it; | - | ||||||||||||||||||||||||
| 2722 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_model); | - | ||||||||||||||||||||||||
| 2723 | flags = model->release(package); | - | ||||||||||||||||||||||||
| 2724 | m_packaged.erase(it); | - | ||||||||||||||||||||||||
| 2725 | if (!m_packaged.contains(item)
| 566-2736 | ||||||||||||||||||||||||
| 2726 | flags &= ~Referenced; executed 2736 times by 4 tests: flags &= ~Referenced;Executed by:
| 2736 | ||||||||||||||||||||||||
| 2727 | if (flags & Destroyed
| 1648-1654 | ||||||||||||||||||||||||
| 2728 | QQmlDelegateModelPrivate::get(m_model)->emitDestroyingPackage(package); executed 1654 times by 3 tests: QQmlDelegateModelPrivate::get(m_model)->emitDestroyingPackage(package);Executed by:
| 1654 | ||||||||||||||||||||||||
| 2729 | } executed 3302 times by 4 tests: end of blockExecuted by:
| 3302 | ||||||||||||||||||||||||
| 2730 | return executed 3302 times by 4 tests: flags;return flags;Executed by:
executed 3302 times by 4 tests: return flags;Executed by:
| 3302 | ||||||||||||||||||||||||
| 2731 | } | - | ||||||||||||||||||||||||
| 2732 | - | |||||||||||||||||||||||||
| 2733 | QString QQmlPartsModel::stringValue(int index, const QString &role) | - | ||||||||||||||||||||||||
| 2734 | { | - | ||||||||||||||||||||||||
| 2735 | return executed 404 times by 1 test: QQmlDelegateModelPrivate::get(m_model)->stringValue(m_compositorGroup, index, role);return QQmlDelegateModelPrivate::get(m_model)->stringValue(m_compositorGroup, index, role);Executed by:
executed 404 times by 1 test: return QQmlDelegateModelPrivate::get(m_model)->stringValue(m_compositorGroup, index, role);Executed by:
| 404 | ||||||||||||||||||||||||
| 2736 | } | - | ||||||||||||||||||||||||
| 2737 | - | |||||||||||||||||||||||||
| 2738 | void QQmlPartsModel::setWatchedRoles(const QList<QByteArray> &roles) | - | ||||||||||||||||||||||||
| 2739 | { | - | ||||||||||||||||||||||||
| 2740 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_model); | - | ||||||||||||||||||||||||
| 2741 | model->m_adaptorModel.replaceWatchedRoles(m_watchedRoles, roles); | - | ||||||||||||||||||||||||
| 2742 | m_watchedRoles = roles; | - | ||||||||||||||||||||||||
| 2743 | } executed 348 times by 3 tests: end of blockExecuted by:
| 348 | ||||||||||||||||||||||||
| 2744 | - | |||||||||||||||||||||||||
| 2745 | QQmlIncubator::Status QQmlPartsModel::incubationStatus(int index) | - | ||||||||||||||||||||||||
| 2746 | { | - | ||||||||||||||||||||||||
| 2747 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_model); | - | ||||||||||||||||||||||||
| 2748 | Compositor::iterator it = model->m_compositor.find(model->m_compositorGroup, index); | - | ||||||||||||||||||||||||
| 2749 | if (!it->inCache()
| 0-2 | ||||||||||||||||||||||||
| 2750 | return never executed: QQmlIncubator::Null;return QQmlIncubator::Null;never executed: return QQmlIncubator::Null; | 0 | ||||||||||||||||||||||||
| 2751 | - | |||||||||||||||||||||||||
| 2752 | if (auto incubationTask = model->m_cache.at(it.cacheIndex)->incubationTask
| 0-2 | ||||||||||||||||||||||||
| 2753 | return executed 2 times by 1 test: incubationTask->status();return incubationTask->status();Executed by:
executed 2 times by 1 test: return incubationTask->status();Executed by:
| 2 | ||||||||||||||||||||||||
| 2754 | - | |||||||||||||||||||||||||
| 2755 | return never executed: QQmlIncubator::Ready;return QQmlIncubator::Ready;never executed: return QQmlIncubator::Ready; | 0 | ||||||||||||||||||||||||
| 2756 | } | - | ||||||||||||||||||||||||
| 2757 | - | |||||||||||||||||||||||||
| 2758 | int QQmlPartsModel::indexOf(QObject *item, QObject *) const | - | ||||||||||||||||||||||||
| 2759 | { | - | ||||||||||||||||||||||||
| 2760 | QHash<QObject *, QQuickPackage *>::const_iterator it = m_packaged.find(item); | - | ||||||||||||||||||||||||
| 2761 | if (it != m_packaged.end()
| 272-1372 | ||||||||||||||||||||||||
| 2762 | if (QQmlDelegateModelItem *cacheItem = QQmlDelegateModelItem::dataForObject(*it)
| 0-272 | ||||||||||||||||||||||||
| 2763 | return never executed: cacheItem->groupIndex(m_compositorGroup);return cacheItem->groupIndex(m_compositorGroup);never executed: return cacheItem->groupIndex(m_compositorGroup); | 0 | ||||||||||||||||||||||||
| 2764 | } executed 272 times by 1 test: end of blockExecuted by:
| 272 | ||||||||||||||||||||||||
| 2765 | return executed 1644 times by 4 tests: -1;return -1;Executed by:
executed 1644 times by 4 tests: return -1;Executed by:
| 1644 | ||||||||||||||||||||||||
| 2766 | } | - | ||||||||||||||||||||||||
| 2767 | - | |||||||||||||||||||||||||
| 2768 | void QQmlPartsModel::createdPackage(int index, QQuickPackage *package) | - | ||||||||||||||||||||||||
| 2769 | { | - | ||||||||||||||||||||||||
| 2770 | createdItem(index, package->part(m_part)); | - | ||||||||||||||||||||||||
| 2771 | } executed 5226 times by 6 tests: end of blockExecuted by:
| 5226 | ||||||||||||||||||||||||
| 2772 | - | |||||||||||||||||||||||||
| 2773 | void QQmlPartsModel::initPackage(int index, QQuickPackage *package) | - | ||||||||||||||||||||||||
| 2774 | { | - | ||||||||||||||||||||||||
| 2775 | if (m_modelUpdatePending
| 2-5224 | ||||||||||||||||||||||||
| 2776 | m_pendingPackageInitializations << index; executed 2 times by 1 test: m_pendingPackageInitializations << index;Executed by:
| 2 | ||||||||||||||||||||||||
| 2777 | else | - | ||||||||||||||||||||||||
| 2778 | initItem(index, package->part(m_part)); executed 5224 times by 6 tests: initItem(index, package->part(m_part));Executed by:
| 5224 | ||||||||||||||||||||||||
| 2779 | } | - | ||||||||||||||||||||||||
| 2780 | - | |||||||||||||||||||||||||
| 2781 | void QQmlPartsModel::destroyingPackage(QQuickPackage *package) | - | ||||||||||||||||||||||||
| 2782 | { | - | ||||||||||||||||||||||||
| 2783 | QObject *item = package->part(m_part); | - | ||||||||||||||||||||||||
| 2784 | ((!m_packaged.contains(item)) ? static_cast<void>(0) : qt_assert("!m_packaged.contains(item)", __FILE__, 3312)); | - | ||||||||||||||||||||||||
| 2785 | destroyingItem(item); | - | ||||||||||||||||||||||||
| 2786 | } executed 1698 times by 3 tests: end of blockExecuted by:
| 1698 | ||||||||||||||||||||||||
| 2787 | - | |||||||||||||||||||||||||
| 2788 | void QQmlPartsModel::emitModelUpdated(const QQmlChangeSet &changeSet, bool reset) | - | ||||||||||||||||||||||||
| 2789 | { | - | ||||||||||||||||||||||||
| 2790 | m_modelUpdatePending = false; | - | ||||||||||||||||||||||||
| 2791 | modelUpdated(changeSet, reset); | - | ||||||||||||||||||||||||
| 2792 | if (changeSet.difference() != 0
| 410-1060 | ||||||||||||||||||||||||
| 2793 | countChanged(); executed 1060 times by 6 tests: countChanged();Executed by:
| 1060 | ||||||||||||||||||||||||
| 2794 | - | |||||||||||||||||||||||||
| 2795 | QQmlDelegateModelPrivate *model = QQmlDelegateModelPrivate::get(m_model); | - | ||||||||||||||||||||||||
| 2796 | QVector<int> pendingPackageInitializations; | - | ||||||||||||||||||||||||
| 2797 | qSwap(pendingPackageInitializations, m_pendingPackageInitializations); | - | ||||||||||||||||||||||||
| 2798 | for (int index : pendingPackageInitializations) { | - | ||||||||||||||||||||||||
| 2799 | if (!model->m_delegate
| 0-2 | ||||||||||||||||||||||||
| 2800 | continue; never executed: continue; | 0 | ||||||||||||||||||||||||
| 2801 | QObject *object = model->object(m_compositorGroup, index, QQmlIncubator::Asynchronous); | - | ||||||||||||||||||||||||
| 2802 | if (QQuickPackage *package = qmlobject_cast<QQuickPackage *>(object)
| 0-2 | ||||||||||||||||||||||||
| 2803 | initItem(index, package->part(m_part)); executed 2 times by 1 test: initItem(index, package->part(m_part));Executed by:
| 2 | ||||||||||||||||||||||||
| 2804 | model->release(object); | - | ||||||||||||||||||||||||
| 2805 | } executed 2 times by 1 test: end of blockExecuted by:
| 2 | ||||||||||||||||||||||||
| 2806 | } executed 1470 times by 6 tests: end of blockExecuted by:
| 1470 | ||||||||||||||||||||||||
| 2807 | - | |||||||||||||||||||||||||
| 2808 | - | |||||||||||||||||||||||||
| 2809 | - | |||||||||||||||||||||||||
| 2810 | struct QQmlDelegateModelGroupChange : QV4::Object | - | ||||||||||||||||||||||||
| 2811 | { | - | ||||||||||||||||||||||||
| 2812 | private: QQmlDelegateModelGroupChange() = delete; QQmlDelegateModelGroupChange(const QQmlDelegateModelGroupChange &) = delete; QQmlDelegateModelGroupChange &operator=(const QQmlDelegateModelGroupChange &) = delete; public: template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; } executed 166 times by 1 test: typedef QV4::Heap::QQmlDelegateModelGroupChange Data; typedef QV4::Object SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blockExecuted by:
executed 664 times by 1 test: &static_vtbl;return &static_vtbl;Executed by:
executed 664 times by 1 test: } void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }return &static_vtbl;Executed by:
never executed: QV4::Heap::QQmlDelegateModelGroupChange *d_unchecked() const { returnend of blockexecuted 696 times by 1 test: static_cast<QV4::Heap::QQmlDelegateModelGroupChange *>(m());return static_cast<QV4::Heap::QQmlDelegateModelGroupChange *>(m());Executed by:
executed 696 times by 1 test: } QV4::Heap::QQmlDelegateModelGroupChange *d() const { QV4::Heap::QQmlDelegateModelGroupChange *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::QQmlDelegateModelGroupChange *>(m());Executed by:
executed 530 times by 1 test: dptr;return dptr;Executed by:
executed 530 times by 1 test: } static_assert(bool(std::is_trivial< QV4::Heap::QQmlDelegateModelGroupChange >::value), "std::is_trivial< QV4::Heap::QQmlDelegateModelGroupChange >::value");return dptr;Executed by:
| 0-696 | ||||||||||||||||||||||||
| 2813 | - | |||||||||||||||||||||||||
| 2814 | static QV4::Heap::QQmlDelegateModelGroupChange *create(QV4::ExecutionEngine *e) { | - | ||||||||||||||||||||||||
| 2815 | return executed 166 times by 1 test: e->memoryManager->allocate<QQmlDelegateModelGroupChange>();return e->memoryManager->allocate<QQmlDelegateModelGroupChange>();Executed by:
executed 166 times by 1 test: return e->memoryManager->allocate<QQmlDelegateModelGroupChange>();Executed by:
| 166 | ||||||||||||||||||||||||
| 2816 | } | - | ||||||||||||||||||||||||
| 2817 | - | |||||||||||||||||||||||||
| 2818 | static QV4::ReturnedValue method_get_index(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) { | - | ||||||||||||||||||||||||
| 2819 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||
| 2820 | QV4::Scoped<QQmlDelegateModelGroupChange> that(scope, thisObject->as<QQmlDelegateModelGroupChange>()); | - | ||||||||||||||||||||||||
| 2821 | if (!that
| 0-50 | ||||||||||||||||||||||||
| 2822 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 2823 | return executed 50 times by 1 test: QV4::Encode(that->d()->change.index);return QV4::Encode(that->d()->change.index);Executed by:
executed 50 times by 1 test: return QV4::Encode(that->d()->change.index);Executed by:
| 50 | ||||||||||||||||||||||||
| 2824 | } | - | ||||||||||||||||||||||||
| 2825 | static QV4::ReturnedValue method_get_count(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) { | - | ||||||||||||||||||||||||
| 2826 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||
| 2827 | QV4::Scoped<QQmlDelegateModelGroupChange> that(scope, thisObject->as<QQmlDelegateModelGroupChange>()); | - | ||||||||||||||||||||||||
| 2828 | if (!that
| 0-50 | ||||||||||||||||||||||||
| 2829 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 2830 | return executed 50 times by 1 test: QV4::Encode(that->d()->change.count);return QV4::Encode(that->d()->change.count);Executed by:
executed 50 times by 1 test: return QV4::Encode(that->d()->change.count);Executed by:
| 50 | ||||||||||||||||||||||||
| 2831 | } | - | ||||||||||||||||||||||||
| 2832 | static QV4::ReturnedValue method_get_moveId(const QV4::FunctionObject *b, const QV4::Value *thisObject, const QV4::Value *, int) { | - | ||||||||||||||||||||||||
| 2833 | QV4::Scope scope(b); | - | ||||||||||||||||||||||||
| 2834 | QV4::Scoped<QQmlDelegateModelGroupChange> that(scope, thisObject->as<QQmlDelegateModelGroupChange>()); | - | ||||||||||||||||||||||||
| 2835 | if (!that
| 0-66 | ||||||||||||||||||||||||
| 2836 | return never executed: scope.engine->throwTypeError();return scope.engine->throwTypeError();never executed: return scope.engine->throwTypeError(); | 0 | ||||||||||||||||||||||||
| 2837 | if (that->d()->change.moveId < 0
| 32-34 | ||||||||||||||||||||||||
| 2838 | return executed 34 times by 1 test: QV4::Encode::undefined();return QV4::Encode::undefined();Executed by:
executed 34 times by 1 test: return QV4::Encode::undefined();Executed by:
| 34 | ||||||||||||||||||||||||
| 2839 | return executed 32 times by 1 test: QV4::Encode(that->d()->change.moveId);return QV4::Encode(that->d()->change.moveId);Executed by:
executed 32 times by 1 test: return QV4::Encode(that->d()->change.moveId);Executed by:
| 32 | ||||||||||||||||||||||||
| 2840 | } | - | ||||||||||||||||||||||||
| 2841 | }; | - | ||||||||||||||||||||||||
| 2842 | - | |||||||||||||||||||||||||
| 2843 | const QV4::VTable QQmlDelegateModelGroupChange::static_vtbl = { (std::is_same<QQmlDelegateModelGroupChange::SuperClass, Object>::value) ? nullptr : &QQmlDelegateModelGroupChange::SuperClass::static_vtbl, (sizeof(QQmlDelegateModelGroupChange::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(QQmlDelegateModelGroupChange::Data) + (QQmlDelegateModelGroupChange::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(QQmlDelegateModelGroupChange::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), QQmlDelegateModelGroupChange::IsExecutionContext, QQmlDelegateModelGroupChange::IsString, QQmlDelegateModelGroupChange::IsObject, QQmlDelegateModelGroupChange::IsFunctionObject, QQmlDelegateModelGroupChange::IsErrorObject, QQmlDelegateModelGroupChange::IsArrayData, QQmlDelegateModelGroupChange::IsStringOrSymbol, QQmlDelegateModelGroupChange::MyType, { 0, 0, 0, 0 }, "QQmlDelegateModelGroupChange", QQmlDelegateModelGroupChange::virtualDestroy, QQmlDelegateModelGroupChange::Data::markObjects, QQmlDelegateModelGroupChange::virtualIsEqualTo, QQmlDelegateModelGroupChange::virtualGet, QQmlDelegateModelGroupChange::virtualPut, QQmlDelegateModelGroupChange::virtualDeleteProperty, QQmlDelegateModelGroupChange::virtualHasProperty, QQmlDelegateModelGroupChange::virtualGetOwnProperty, QQmlDelegateModelGroupChange::virtualDefineOwnProperty, QQmlDelegateModelGroupChange::virtualIsExtensible, QQmlDelegateModelGroupChange::virtualPreventExtensions, QQmlDelegateModelGroupChange::virtualGetPrototypeOf, QQmlDelegateModelGroupChange::virtualSetPrototypeOf, QQmlDelegateModelGroupChange::virtualGetLength, QQmlDelegateModelGroupChange::virtualAdvanceIterator, QQmlDelegateModelGroupChange::virtualInstanceOf, QQmlDelegateModelGroupChange::virtualCall, QQmlDelegateModelGroupChange::virtualCallAsConstructor, }; | - | ||||||||||||||||||||||||
| 2844 | - | |||||||||||||||||||||||||
| 2845 | struct QQmlDelegateModelGroupChangeArray : public QV4::Object | - | ||||||||||||||||||||||||
| 2846 | { | - | ||||||||||||||||||||||||
| 2847 | private: QQmlDelegateModelGroupChangeArray() = delete; QQmlDelegateModelGroupChangeArray(const QQmlDelegateModelGroupChangeArray &) = delete; QQmlDelegateModelGroupChangeArray &operator=(const QQmlDelegateModelGroupChangeArray &) = delete; public: template <typename Type> inline void qt_check_for_QMANAGED_macro(const Type *_q_argument) const { int i = qYouForgotTheQ_MANAGED_Macro(this, _q_argument); i = i + 1; } executed 536 times by 1 test: typedef QV4::Heap::QQmlDelegateModelGroupChangeArray Data; typedef QV4::Object SuperClass; static const QV4::VTable static_vtbl; static inline const QV4::VTable *staticVTable() { returnend of blockExecuted by:
executed 1028 times by 2 tests: &static_vtbl;return &static_vtbl;Executed by:
executed 1028 times by 2 tests: } void __dataTest() { static_assert (sizeof(*this) == sizeof(Managed), "Classes derived from Managed can't have own data members."); }return &static_vtbl;Executed by:
never executed: QV4::Heap::QQmlDelegateModelGroupChangeArray *d_unchecked() const { returnend of blockexecuted 1030 times by 2 tests: static_cast<QV4::Heap::QQmlDelegateModelGroupChangeArray *>(m());return static_cast<QV4::Heap::QQmlDelegateModelGroupChangeArray *>(m());Executed by:
executed 1030 times by 2 tests: } QV4::Heap::QQmlDelegateModelGroupChangeArray *d() const { QV4::Heap::QQmlDelegateModelGroupChangeArray *dptr = d_unchecked(); dptr->_checkIsInitialized(); returnreturn static_cast<QV4::Heap::QQmlDelegateModelGroupChangeArray *>(m());Executed by:
executed 866 times by 2 tests: dptr;return dptr;Executed by:
executed 866 times by 2 tests: } static_assert(bool(std::is_trivial< QV4::Heap::QQmlDelegateModelGroupChangeArray >::value), "std::is_trivial< QV4::Heap::QQmlDelegateModelGroupChangeArray >::value");return dptr;Executed by:
| 0-1030 | ||||||||||||||||||||||||
| 2848 | static void virtualDestroy(QV4::Heap::Base *b) { static_cast<Data *>(b)->destroy(); } executed 164 times by 2 tests: end of blockExecuted by:
| 164 | ||||||||||||||||||||||||
| 2849 | public: | - | ||||||||||||||||||||||||
| 2850 | static QV4::Heap::QQmlDelegateModelGroupChangeArray *create(QV4::ExecutionEngine *engine, const QVector<QQmlChangeSet::Change> &changes) | - | ||||||||||||||||||||||||
| 2851 | { | - | ||||||||||||||||||||||||
| 2852 | return executed 164 times by 2 tests: engine->memoryManager->allocate<QQmlDelegateModelGroupChangeArray>(changes);return engine->memoryManager->allocate<QQmlDelegateModelGroupChangeArray>(changes);Executed by:
executed 164 times by 2 tests: return engine->memoryManager->allocate<QQmlDelegateModelGroupChangeArray>(changes);Executed by:
| 164 | ||||||||||||||||||||||||
| 2853 | } | - | ||||||||||||||||||||||||
| 2854 | - | |||||||||||||||||||||||||
| 2855 | quint32 count() const { return executed 536 times by 1 test: d()->changes->count();return d()->changes->count();Executed by:
executed 536 times by 1 test: }return d()->changes->count();Executed by:
| 536 | ||||||||||||||||||||||||
| 2856 | const QQmlChangeSet::Change &at(int index) const { return executed 166 times by 1 test: d()->changes->at(index);return d()->changes->at(index);Executed by:
executed 166 times by 1 test: }return d()->changes->at(index);Executed by:
| 166 | ||||||||||||||||||||||||
| 2857 | - | |||||||||||||||||||||||||
| 2858 | static QV4::ReturnedValue virtualGet(const QV4::Managed *m, QV4::PropertyKey id, const QV4::Value *receiver, bool *hasProperty) | - | ||||||||||||||||||||||||
| 2859 | { | - | ||||||||||||||||||||||||
| 2860 | if (id.isArrayIndex()
| 166-370 | ||||||||||||||||||||||||
| 2861 | uint index = id.asArrayIndex(); | - | ||||||||||||||||||||||||
| 2862 | ((m->as<QQmlDelegateModelGroupChangeArray>()) ? static_cast<void>(0) : qt_assert("m->as<QQmlDelegateModelGroupChangeArray>()", __FILE__, 3390)); | - | ||||||||||||||||||||||||
| 2863 | QV4::ExecutionEngine *v4 = static_cast<const QQmlDelegateModelGroupChangeArray *>(m)->engine(); | - | ||||||||||||||||||||||||
| 2864 | QV4::Scope scope(v4); | - | ||||||||||||||||||||||||
| 2865 | QV4::Scoped<QQmlDelegateModelGroupChangeArray> array(scope, static_cast<const QQmlDelegateModelGroupChangeArray *>(m)); | - | ||||||||||||||||||||||||
| 2866 | - | |||||||||||||||||||||||||
| 2867 | if (index >= array->count()
| 0-166 | ||||||||||||||||||||||||
| 2868 | if (hasProperty
| 0 | ||||||||||||||||||||||||
| 2869 | * never executed: hasProperty = false;*hasProperty = false;never executed: *hasProperty = false; | 0 | ||||||||||||||||||||||||
| 2870 | return never executed: QV4::Primitive::undefinedValue().asReturnedValue();return QV4::Primitive::undefinedValue().asReturnedValue();never executed: return QV4::Primitive::undefinedValue().asReturnedValue(); | 0 | ||||||||||||||||||||||||
| 2871 | } | - | ||||||||||||||||||||||||
| 2872 | - | |||||||||||||||||||||||||
| 2873 | const QQmlChangeSet::Change &change = array->at(index); | - | ||||||||||||||||||||||||
| 2874 | - | |||||||||||||||||||||||||
| 2875 | QV4::ScopedObject changeProto(scope, engineData(v4)->changeProto.value()); | - | ||||||||||||||||||||||||
| 2876 | QV4::Scoped<QQmlDelegateModelGroupChange> object(scope, QQmlDelegateModelGroupChange::create(v4)); | - | ||||||||||||||||||||||||
| 2877 | object->setPrototypeOf(changeProto); | - | ||||||||||||||||||||||||
| 2878 | object->d()->change = change; | - | ||||||||||||||||||||||||
| 2879 | - | |||||||||||||||||||||||||
| 2880 | if (hasProperty
| 0-166 | ||||||||||||||||||||||||
| 2881 | * never executed: hasProperty = true;*hasProperty = true;never executed: *hasProperty = true; | 0 | ||||||||||||||||||||||||
| 2882 | return executed 166 times by 1 test: object.asReturnedValue();return object.asReturnedValue();Executed by:
executed 166 times by 1 test: return object.asReturnedValue();Executed by:
| 166 | ||||||||||||||||||||||||
| 2883 | } | - | ||||||||||||||||||||||||
| 2884 | - | |||||||||||||||||||||||||
| 2885 | ((m->as<QQmlDelegateModelGroupChangeArray>()) ? static_cast<void>(0) : qt_assert("m->as<QQmlDelegateModelGroupChangeArray>()", __FILE__, 3413)); | - | ||||||||||||||||||||||||
| 2886 | const QQmlDelegateModelGroupChangeArray *array = static_cast<const QQmlDelegateModelGroupChangeArray *>(m); | - | ||||||||||||||||||||||||
| 2887 | - | |||||||||||||||||||||||||
| 2888 | if (id == array->engine()->id_length()->propertyKey()
| 0-370 | ||||||||||||||||||||||||
| 2889 | if (hasProperty
| 0-370 | ||||||||||||||||||||||||
| 2890 | * never executed: hasProperty = true;*hasProperty = true;never executed: *hasProperty = true; | 0 | ||||||||||||||||||||||||
| 2891 | return executed 370 times by 1 test: QV4::Encode(array->count());return QV4::Encode(array->count());Executed by:
executed 370 times by 1 test: return QV4::Encode(array->count());Executed by:
| 370 | ||||||||||||||||||||||||
| 2892 | } | - | ||||||||||||||||||||||||
| 2893 | - | |||||||||||||||||||||||||
| 2894 | return never executed: Object::virtualGet(m, id, receiver, hasProperty);return Object::virtualGet(m, id, receiver, hasProperty);never executed: return Object::virtualGet(m, id, receiver, hasProperty); | 0 | ||||||||||||||||||||||||
| 2895 | } | - | ||||||||||||||||||||||||
| 2896 | }; | - | ||||||||||||||||||||||||
| 2897 | - | |||||||||||||||||||||||||
| 2898 | void QV4::Heap::QQmlDelegateModelGroupChangeArray::init(const QVector<QQmlChangeSet::Change> &changes) | - | ||||||||||||||||||||||||
| 2899 | { | - | ||||||||||||||||||||||||
| 2900 | Object::init(); | - | ||||||||||||||||||||||||
| 2901 | this->changes = new QVector<QQmlChangeSet::Change>(changes); | - | ||||||||||||||||||||||||
| 2902 | QV4::Scope scope(internalClass->engine); | - | ||||||||||||||||||||||||
| 2903 | QV4::ScopedObject o(scope, this); | - | ||||||||||||||||||||||||
| 2904 | o->setArrayType(QV4::Heap::ArrayData::Custom); | - | ||||||||||||||||||||||||
| 2905 | } executed 164 times by 2 tests: end of blockExecuted by:
| 164 | ||||||||||||||||||||||||
| 2906 | - | |||||||||||||||||||||||||
| 2907 | const QV4::VTable QQmlDelegateModelGroupChangeArray::static_vtbl = { (std::is_same<QQmlDelegateModelGroupChangeArray::SuperClass, Object>::value) ? nullptr : &QQmlDelegateModelGroupChangeArray::SuperClass::static_vtbl, (sizeof(QQmlDelegateModelGroupChangeArray::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), (sizeof(QQmlDelegateModelGroupChangeArray::Data) + (QQmlDelegateModelGroupChangeArray::NInlineProperties*sizeof(QV4::Value)) + QV4::Chunk::SlotSize - 1)/QV4::Chunk::SlotSize*QV4::Chunk::SlotSize/sizeof(QV4::Value) - (sizeof(QQmlDelegateModelGroupChangeArray::Data) + sizeof(QV4::Value) - 1)/sizeof(QV4::Value), QQmlDelegateModelGroupChangeArray::IsExecutionContext, QQmlDelegateModelGroupChangeArray::IsString, QQmlDelegateModelGroupChangeArray::IsObject, QQmlDelegateModelGroupChangeArray::IsFunctionObject, QQmlDelegateModelGroupChangeArray::IsErrorObject, QQmlDelegateModelGroupChangeArray::IsArrayData, QQmlDelegateModelGroupChangeArray::IsStringOrSymbol, QQmlDelegateModelGroupChangeArray::MyType, { 0, 0, 0, 0 }, "QQmlDelegateModelGroupChangeArray", QQmlDelegateModelGroupChangeArray::virtualDestroy, QQmlDelegateModelGroupChangeArray::Data::markObjects, QQmlDelegateModelGroupChangeArray::virtualIsEqualTo, QQmlDelegateModelGroupChangeArray::virtualGet, QQmlDelegateModelGroupChangeArray::virtualPut, QQmlDelegateModelGroupChangeArray::virtualDeleteProperty, QQmlDelegateModelGroupChangeArray::virtualHasProperty, QQmlDelegateModelGroupChangeArray::virtualGetOwnProperty, QQmlDelegateModelGroupChangeArray::virtualDefineOwnProperty, QQmlDelegateModelGroupChangeArray::virtualIsExtensible, QQmlDelegateModelGroupChangeArray::virtualPreventExtensions, QQmlDelegateModelGroupChangeArray::virtualGetPrototypeOf, QQmlDelegateModelGroupChangeArray::virtualSetPrototypeOf, QQmlDelegateModelGroupChangeArray::virtualGetLength, QQmlDelegateModelGroupChangeArray::virtualAdvanceIterator, QQmlDelegateModelGroupChangeArray::virtualInstanceOf, QQmlDelegateModelGroupChangeArray::virtualCall, QQmlDelegateModelGroupChangeArray::virtualCallAsConstructor, }; | - | ||||||||||||||||||||||||
| 2908 | - | |||||||||||||||||||||||||
| 2909 | QQmlDelegateModelEngineData::QQmlDelegateModelEngineData(QV4::ExecutionEngine *v4) | - | ||||||||||||||||||||||||
| 2910 | { | - | ||||||||||||||||||||||||
| 2911 | QV4::Scope scope(v4); | - | ||||||||||||||||||||||||
| 2912 | - | |||||||||||||||||||||||||
| 2913 | QV4::ScopedObject proto(scope, v4->newObject()); | - | ||||||||||||||||||||||||
| 2914 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "index")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "index" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 4 times by 2 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 4 times by 2 tests: }()), QQmlDelegateModelGroupChange::method_get_index, nullptr);return qstring_literal_temp;Executed by:
| 4 | ||||||||||||||||||||||||
| 2915 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "count")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "count" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 4 times by 2 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 4 times by 2 tests: }()), QQmlDelegateModelGroupChange::method_get_count, nullptr);return qstring_literal_temp;Executed by:
| 4 | ||||||||||||||||||||||||
| 2916 | proto->defineAccessorProperty(([]() noexcept -> QString { enum { Size = sizeof(u"" "moveId")/2 - 1 }; static const QStaticStringData<Size> qstring_literal = { { { { -1 } }, Size, 0, 0, sizeof(QStringData) }, u"" "moveId" }; QStringDataPtr holder = { qstring_literal.data_ptr() }; const QString qstring_literal_temp(holder); return executed 4 times by 2 tests: qstring_literal_temp;return qstring_literal_temp;Executed by:
executed 4 times by 2 tests: }()), QQmlDelegateModelGroupChange::method_get_moveId, nullptr);return qstring_literal_temp;Executed by:
| 4 | ||||||||||||||||||||||||
| 2917 | changeProto.set(v4, proto); | - | ||||||||||||||||||||||||
| 2918 | } executed 4 times by 2 tests: end of blockExecuted by:
| 4 | ||||||||||||||||||||||||
| 2919 | - | |||||||||||||||||||||||||
| 2920 | QQmlDelegateModelEngineData::~QQmlDelegateModelEngineData() | - | ||||||||||||||||||||||||
| 2921 | { | - | ||||||||||||||||||||||||
| 2922 | } | - | ||||||||||||||||||||||||
| 2923 | - | |||||||||||||||||||||||||
| 2924 | QV4::ReturnedValue QQmlDelegateModelEngineData::array(QV4::ExecutionEngine *v4, | - | ||||||||||||||||||||||||
| 2925 | const QVector<QQmlChangeSet::Change> &changes) | - | ||||||||||||||||||||||||
| 2926 | { | - | ||||||||||||||||||||||||
| 2927 | QV4::Scope scope(v4); | - | ||||||||||||||||||||||||
| 2928 | QV4::ScopedObject o(scope, QQmlDelegateModelGroupChangeArray::create(v4, changes)); | - | ||||||||||||||||||||||||
| 2929 | return executed 164 times by 2 tests: o.asReturnedValue();return o.asReturnedValue();Executed by:
executed 164 times by 2 tests: return o.asReturnedValue();Executed by:
| 164 | ||||||||||||||||||||||||
| 2930 | } | - | ||||||||||||||||||||||||
| 2931 | - | |||||||||||||||||||||||||
| 2932 | - | |||||||||||||||||||||||||
| 2933 | - | |||||||||||||||||||||||||
| Switch to Source code | Preprocessed file |