| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/qqmlobjectcreator_p.h |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | - | |||||||
| 5 | class QQmlAbstractBinding; | - | ||||||
| 6 | struct QQmlTypeCompiler; | - | ||||||
| 7 | class QQmlInstantiationInterrupt; | - | ||||||
| 8 | class QQmlIncubatorPrivate; | - | ||||||
| 9 | - | |||||||
| 10 | struct QQmlObjectCreatorSharedState : public QSharedData | - | ||||||
| 11 | { | - | ||||||
| 12 | QQmlContextData *rootContext; | - | ||||||
| 13 | QQmlContextData *creationContext; | - | ||||||
| 14 | QFiniteStack<QQmlAbstractBinding::Ptr> allCreatedBindings; | - | ||||||
| 15 | QFiniteStack<QQmlParserStatus*> allParserStatusCallbacks; | - | ||||||
| 16 | QFiniteStack<QPointer<QObject> > allCreatedObjects; | - | ||||||
| 17 | QV4::Value *allJavaScriptObjects; | - | ||||||
| 18 | QQmlComponentAttached *componentAttached; | - | ||||||
| 19 | QList<QQmlEnginePrivate::FinalizeCallback> finalizeCallbacks; | - | ||||||
| 20 | QQmlVmeProfiler profiler; | - | ||||||
| 21 | QRecursionNode recursionNode; | - | ||||||
| 22 | }; | - | ||||||
| 23 | - | |||||||
| 24 | class __attribute__((visibility("default"))) QQmlObjectCreator | - | ||||||
| 25 | { | - | ||||||
| 26 | public: static inline QString tr(const char *sourceText, const char *disambiguation = nullptr, int n = -1) { return QCoreApplication::translate("QQmlObjectCreator", sourceText, disambiguation, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *sourceText, const char *disambiguation = nullptr, int n = -1) { return QCoreApplication::translate("QQmlObjectCreator", sourceText, disambiguation, n); } private: | - | ||||||
| 27 | public: | - | ||||||
| 28 | QQmlObjectCreator(QQmlContextData *parentContext, const QQmlRefPointer<QV4::CompiledData::CompilationUnit> &compilationUnit, QQmlContextData *creationContext, QQmlIncubatorPrivate *incubator = nullptr); | - | ||||||
| 29 | ~QQmlObjectCreator(); | - | ||||||
| 30 | - | |||||||
| 31 | QObject *create(int subComponentIndex = -1, QObject *parent = nullptr, QQmlInstantiationInterrupt *interrupt = nullptr); | - | ||||||
| 32 | bool populateDeferredProperties(QObject *instance, QQmlData::DeferredData *deferredData); | - | ||||||
| 33 | bool populateDeferredBinding(const QQmlProperty &qmlProperty, QQmlData::DeferredData *deferredData, const QV4::CompiledData::Binding *binding); | - | ||||||
| 34 | QQmlContextData *finalize(QQmlInstantiationInterrupt &interrupt); | - | ||||||
| 35 | void clear(); | - | ||||||
| 36 | - | |||||||
| 37 | QQmlComponentAttached **componentAttachment() const { return executed 4457 times by 59 tests: &sharedState->componentAttached;return &sharedState->componentAttached;Executed by:
executed 4457 times by 59 tests: }return &sharedState->componentAttached;Executed by:
| 4457 | ||||||
| 38 | - | |||||||
| 39 | QList<QQmlEnginePrivate::FinalizeCallback> *finalizeCallbacks() const { return never executed: &sharedState->finalizeCallbacks;return &sharedState->finalizeCallbacks;never executed: }return &sharedState->finalizeCallbacks; | 0 | ||||||
| 40 | - | |||||||
| 41 | QList<QQmlError> errors; | - | ||||||
| 42 | - | |||||||
| 43 | QQmlContextData *parentContextData() const { return executed 4577 times by 11 tests: parentContext.contextData();return parentContext.contextData();Executed by:
executed 4577 times by 11 tests: }return parentContext.contextData();Executed by:
| 4577 | ||||||
| 44 | QFiniteStack<QPointer<QObject> > &allCreatedObjects() const { return executed 4579 times by 11 tests: sharedState->allCreatedObjects;return sharedState->allCreatedObjects;Executed by:
executed 4579 times by 11 tests: }return sharedState->allCreatedObjects;Executed by:
| 4579 | ||||||
| 45 | - | |||||||
| 46 | private: | - | ||||||
| 47 | QQmlObjectCreator(QQmlContextData *contextData, const QQmlRefPointer<QV4::CompiledData::CompilationUnit> &compilationUnit, QQmlObjectCreatorSharedState *inheritedSharedState); | - | ||||||
| 48 | - | |||||||
| 49 | void init(QQmlContextData *parentContext); | - | ||||||
| 50 | - | |||||||
| 51 | QObject *createInstance(int index, QObject *parent = nullptr, bool isContextObject = false); | - | ||||||
| 52 | - | |||||||
| 53 | bool populateInstance(int index, QObject *instance, | - | ||||||
| 54 | QObject *bindingTarget, const QQmlPropertyData *valueTypeProperty); | - | ||||||
| 55 | - | |||||||
| 56 | void setupBindings(bool applyDeferredBindings = false); | - | ||||||
| 57 | bool setPropertyBinding(const QQmlPropertyData *property, const QV4::CompiledData::Binding *binding); | - | ||||||
| 58 | void setPropertyValue(const QQmlPropertyData *property, const QV4::CompiledData::Binding *binding); | - | ||||||
| 59 | void setupFunctions(); | - | ||||||
| 60 | - | |||||||
| 61 | QString stringAt(int idx) const { return executed 124052 times by 106 tests: qmlUnit->stringAt(idx);return qmlUnit->stringAt(idx);Executed by:
executed 124052 times by 106 tests: }return qmlUnit->stringAt(idx);Executed by:
| 124052 | ||||||
| 62 | void recordError(const QV4::CompiledData::Location &location, const QString &description); | - | ||||||
| 63 | - | |||||||
| 64 | void registerObjectWithContextById(const QV4::CompiledData::Object *object, QObject *instance) const; | - | ||||||
| 65 | - | |||||||
| 66 | inline QV4::QmlContext *currentQmlContext(); | - | ||||||
| 67 | __attribute__((noinline)) void createQmlContext(); | - | ||||||
| 68 | - | |||||||
| 69 | enum Phase { | - | ||||||
| 70 | Startup, | - | ||||||
| 71 | CreatingObjects, | - | ||||||
| 72 | CreatingObjectsPhase2, | - | ||||||
| 73 | ObjectsCreated, | - | ||||||
| 74 | Finalizing, | - | ||||||
| 75 | Done | - | ||||||
| 76 | } phase; | - | ||||||
| 77 | - | |||||||
| 78 | QQmlEngine *engine; | - | ||||||
| 79 | QV4::ExecutionEngine *v4; | - | ||||||
| 80 | QQmlRefPointer<QV4::CompiledData::CompilationUnit> compilationUnit; | - | ||||||
| 81 | const QV4::CompiledData::Unit *qmlUnit; | - | ||||||
| 82 | QQmlGuardedContextData parentContext; | - | ||||||
| 83 | QQmlContextData *context; | - | ||||||
| 84 | const QV4::CompiledData::ResolvedTypeReferenceMap &resolvedTypes; | - | ||||||
| 85 | const QQmlPropertyCacheVector *propertyCaches; | - | ||||||
| 86 | QExplicitlySharedDataPointer<QQmlObjectCreatorSharedState> sharedState; | - | ||||||
| 87 | bool topLevelCreator; | - | ||||||
| 88 | QQmlIncubatorPrivate *incubator; | - | ||||||
| 89 | - | |||||||
| 90 | QObject *_qobject; | - | ||||||
| 91 | QObject *_scopeObject; | - | ||||||
| 92 | QObject *_bindingTarget; | - | ||||||
| 93 | - | |||||||
| 94 | const QQmlPropertyData *_valueTypeProperty; | - | ||||||
| 95 | int _compiledObjectIndex; | - | ||||||
| 96 | const QV4::CompiledData::Object *_compiledObject; | - | ||||||
| 97 | QQmlData *_ddata; | - | ||||||
| 98 | QQmlRefPointer<QQmlPropertyCache> _propertyCache; | - | ||||||
| 99 | QQmlVMEMetaObject *_vmeMetaObject; | - | ||||||
| 100 | QQmlListProperty<void> _currentList; | - | ||||||
| 101 | QV4::QmlContext *_qmlContext; | - | ||||||
| 102 | - | |||||||
| 103 | friend struct QQmlObjectCreatorRecursionWatcher; | - | ||||||
| 104 | - | |||||||
| 105 | typedef std::function<bool(QQmlObjectCreatorSharedState *sharedState)> PendingAliasBinding; | - | ||||||
| 106 | std::vector<PendingAliasBinding> pendingAliasBindings; | - | ||||||
| 107 | }; | - | ||||||
| 108 | - | |||||||
| 109 | struct QQmlObjectCreatorRecursionWatcher | - | ||||||
| 110 | { | - | ||||||
| 111 | QQmlObjectCreatorRecursionWatcher(QQmlObjectCreator *creator); | - | ||||||
| 112 | - | |||||||
| 113 | bool hasRecursed() const { return executed 1042801 times by 135 tests: watcher.hasRecursed();return watcher.hasRecursed();Executed by:
executed 1042801 times by 135 tests: }return watcher.hasRecursed();Executed by:
| 1042801 | ||||||
| 114 | - | |||||||
| 115 | private: | - | ||||||
| 116 | QExplicitlySharedDataPointer<QQmlObjectCreatorSharedState> sharedState; | - | ||||||
| 117 | QRecursionWatcher<QQmlObjectCreatorSharedState, &QQmlObjectCreatorSharedState::recursionNode> watcher; | - | ||||||
| 118 | }; | - | ||||||
| 119 | - | |||||||
| 120 | QV4::QmlContext *QQmlObjectCreator::currentQmlContext() | - | ||||||
| 121 | { | - | ||||||
| 122 | if (!_qmlContext->isManaged()
| 190539-427029 | ||||||
| 123 | _qmlContext->setM(QV4::QmlContext::create(v4->rootContext(), context, _scopeObject)); executed 427029 times by 128 tests: _qmlContext->setM(QV4::QmlContext::create(v4->rootContext(), context, _scopeObject));Executed by:
| 427029 | ||||||
| 124 | - | |||||||
| 125 | return executed 617568 times by 128 tests: _qmlContext;return _qmlContext;Executed by:
executed 617568 times by 128 tests: return _qmlContext;Executed by:
| 617568 | ||||||
| 126 | } | - | ||||||
| 127 | - | |||||||
| 128 | - | |||||||
| Switch to Source code | Preprocessed file |