OpenCoverage

qqmlmetatype_p.h #2

Absolute File Name:/home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/qml/qqmlmetatype_p.h
Switch to Source codePreprocessed file
LineSourceCount
1-
2-
3-
4-
5class QQmlType;-
6class QQmlEngine;-
7class QQmlEnginePrivate;-
8class QQmlCustomParser;-
9class QQmlTypePrivate;-
10class QQmlTypeModule;-
11class QHashedString;-
12class QHashedStringRef;-
13class QMutex;-
14class QQmlPropertyCache;-
15class QQmlCompiledData;-
16-
17namespace QV4 { struct String; }-
18-
19void __attribute__((visibility("default"))) qmlUnregisterType(int type);-
20-
21class __attribute__((visibility("default"))) QQmlMetaType-
22{-
23public:-
24 static QQmlType registerCompositeSingletonType(const QQmlPrivate::RegisterCompositeSingletonType &type);-
25 static QQmlType registerCompositeType(const QQmlPrivate::RegisterCompositeType &type);-
26-
27 static void registerInternalCompositeType(QV4::CompiledData::CompilationUnit *compilationUnit);-
28 static void unregisterInternalCompositeType(QV4::CompiledData::CompilationUnit *compilationUnit);-
29-
30 static QList<QString> qmlTypeNames();-
31 static QList<QQmlType> qmlTypes();-
32 static QList<QQmlType> qmlSingletonTypes();-
33 static QList<QQmlType> qmlAllTypes();-
34-
35 enum class TypeIdCategory {-
36 MetaType,-
37 QmlType-
38 };-
39-
40 static QQmlType qmlType(const QString &qualifiedName, int, int);-
41 static QQmlType qmlType(const QHashedStringRef &name, const QHashedStringRef &module, int, int);-
42 static QQmlType qmlType(const QMetaObject *);-
43 static QQmlType qmlType(const QMetaObject *metaObject, const QHashedStringRef &module, int version_major, int version_minor);-
44 static QQmlType qmlType(int typeId, TypeIdCategory category = TypeIdCategory::MetaType);-
45 static QQmlType qmlType(const QUrl &unNormalizedUrl, bool includeNonFileImports = false);-
46-
47 static QQmlPropertyCache *propertyCache(const QMetaObject *metaObject);-
48 static QQmlPropertyCache *propertyCache(const QQmlType &type, int minorVersion);-
49-
50 static void freeUnusedTypesAndCaches();-
51-
52 static QMetaProperty defaultProperty(const QMetaObject *);-
53 static QMetaProperty defaultProperty(QObject *);-
54 static QMetaMethod defaultMethod(const QMetaObject *);-
55 static QMetaMethod defaultMethod(QObject *);-
56-
57 static bool isQObject(int);-
58 static QObject *toQObject(const QVariant &, bool *ok = nullptr);-
59-
60 static int listType(int);-
61 static int attachedPropertiesFuncId(QQmlEnginePrivate *engine, const QMetaObject *);-
62 static QQmlAttachedPropertiesFunc attachedPropertiesFuncById(QQmlEnginePrivate *, int);-
63-
64 enum TypeCategory { Unknown, Object, List };-
65 static TypeCategory typeCategory(int);-
66-
67 static bool isInterface(int);-
68 static const char *interfaceIId(int);-
69 static bool isList(int);-
70-
71 typedef QVariant (*StringConverter)(const QString &);-
72 static void registerCustomStringConverter(int, StringConverter);-
73 static StringConverter customStringConverter(int);-
74-
75 static bool isAnyModule(const QString &uri);-
76 static bool isLockedModule(const QString &uri, int majorVersion);-
77 static bool isModule(const QString &module, int versionMajor, int versionMinor);-
78 static QQmlTypeModule *typeModule(const QString &uri, int majorVersion);-
79-
80 static QList<QQmlPrivate::AutoParentFunction> parentFunctions();-
81-
82 enum class CachedUnitLookupError {-
83 NoError,-
84 NoUnitFound,-
85 VersionMismatch-
86 };-
87-
88 static const QV4::CompiledData::Unit *findCachedCompilationUnit(const QUrl &uri, CachedUnitLookupError *status);-
89-
90-
91 static void prependCachedUnitLookupFunction(QQmlPrivate::QmlUnitCacheLookupFunction handler);-
92 static void removeCachedUnitLookupFunction(QQmlPrivate::QmlUnitCacheLookupFunction handler);-
93-
94 static bool namespaceContainsRegistrations(const QString &, int majorVersion);-
95-
96 static void protectNamespace(const QString &);-
97-
98 static void setTypeRegistrationNamespace(const QString &);-
99-
100 static QMutex *typeRegistrationLock();-
101-
102 static QString prettyTypeName(const QObject *object);-
103};-
104-
105struct QQmlMetaTypeData;-
106class QHashedCStringRef;-
107class QQmlPropertyCache;-
108class __attribute__((visibility("default"))) QQmlType-
109{-
110public:-
111 QQmlType();-
112 QQmlType(const QQmlType &other);-
113 QQmlType &operator =(const QQmlType &other);-
114 explicit QQmlType(QQmlTypePrivate *priv);-
115 ~QQmlType();-
116-
117 bool operator ==(const QQmlType &other) const {-
118 return
executed 1017 times by 32 tests: return d == other.d;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlconsole
  • tst_qqmlecmascript
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickmultipointtoucharea
  • tst_qquickpath
  • tst_qquickpathview
  • tst_qquickpointattractor
  • tst_qquickpositioners
  • tst_qquickshape
  • tst_qquicksmoothedanimation
  • tst_qquicksystempalette
  • ...
d == other.d;
executed 1017 times by 32 tests: return d == other.d;
Executed by:
  • tst_examples
  • tst_flickableinterop
  • tst_qqmlconsole
  • tst_qqmlecmascript
  • tst_qquickaccessible
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickborderimage
  • tst_qquickdraghandler
  • tst_qquickflickable
  • tst_qquickfocusscope
  • tst_qquickgridview
  • tst_qquickimage
  • tst_qquickitem2
  • tst_qquicklayouts
  • tst_qquicklistview
  • tst_qquickmousearea
  • tst_qquickmultipointtoucharea
  • tst_qquickpath
  • tst_qquickpathview
  • tst_qquickpointattractor
  • tst_qquickpositioners
  • tst_qquickshape
  • tst_qquicksmoothedanimation
  • tst_qquicksystempalette
  • ...
1017
119 }-
120-
121 bool isValid() const { return
executed 4198639 times by 142 tests: return d != nullptr;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
d != nullptr;
executed 4198639 times by 142 tests: return d != nullptr;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qjsengine
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlapplicationengine
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlfileselector
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • ...
}
4198639
122 const QQmlTypePrivate *key() const { return
never executed: return d;
d;
never executed: return d;
}
0
123-
124 QByteArray typeName() const;-
125 QString qmlTypeName() const;-
126 QString elementName() const;-
127-
128 QHashedString module() const;-
129 int majorVersion() const;-
130 int minorVersion() const;-
131-
132 bool availableInVersion(int vmajor, int vminor) const;-
133 bool availableInVersion(const QHashedStringRef &module, int vmajor, int vminor) const;-
134-
135 QObject *create() const;-
136 void create(QObject **, void **, size_t) const;-
137-
138 typedef void (*CreateFunc)(void *);-
139 CreateFunc createFunction() const;-
140 int createSize() const;-
141-
142 QQmlCustomParser *customParser() const;-
143-
144 bool isCreatable() const;-
145 bool isExtendedType() const;-
146 QString noCreationReason() const;-
147-
148 bool isSingleton() const;-
149 bool isInterface() const;-
150 bool isComposite() const;-
151 bool isCompositeSingleton() const;-
152-
153 int typeId() const;-
154 int qListTypeId() const;-
155-
156 const QMetaObject *metaObject() const;-
157 const QMetaObject *baseMetaObject() const;-
158 int metaObjectRevision() const;-
159 bool containsRevisionedAttributes() const;-
160-
161 QQmlAttachedPropertiesFunc attachedPropertiesFunction(QQmlEnginePrivate *engine) const;-
162 const QMetaObject *attachedPropertiesType(QQmlEnginePrivate *engine) const;-
163 int attachedPropertiesId(QQmlEnginePrivate *engine) const;-
164-
165 int parserStatusCast() const;-
166 const char *interfaceIId() const;-
167 int propertyValueSourceCast() const;-
168 int propertyValueInterceptorCast() const;-
169-
170 int index() const;-
171-
172 class __attribute__((visibility("default"))) SingletonInstanceInfo-
173 {-
174 public:-
175 SingletonInstanceInfo()-
176 : scriptCallback(nullptr), qobjectCallback(nullptr), instanceMetaObject(nullptr) {}
never executed: end of block
0
177-
178 QJSValue (*scriptCallback)(QQmlEngine *, QJSEngine *);-
179 QObject *(*qobjectCallback)(QQmlEngine *, QJSEngine *);-
180 const QMetaObject *instanceMetaObject;-
181 QString typeName;-
182 QUrl url;-
183-
184 void setQObjectApi(QQmlEngine *, QObject *);-
185 QObject *qobjectApi(QQmlEngine *) const;-
186 void setScriptApi(QQmlEngine *, const QJSValue &);-
187 QJSValue scriptApi(QQmlEngine *) const;-
188-
189 void init(QQmlEngine *);-
190 void destroy(QQmlEngine *);-
191-
192 QHash<QQmlEngine *, QJSValue> scriptApis;-
193 QHash<QQmlEngine *, QObject *> qobjectApis;-
194 };-
195 SingletonInstanceInfo *singletonInstanceInfo() const;-
196-
197 QUrl sourceUrl() const;-
198-
199 int enumValue(QQmlEnginePrivate *engine, const QHashedStringRef &, bool *ok) const;-
200 int enumValue(QQmlEnginePrivate *engine, const QHashedCStringRef &, bool *ok) const;-
201 int enumValue(QQmlEnginePrivate *engine, const QV4::String *, bool *ok) const;-
202-
203 int scopedEnumIndex(QQmlEnginePrivate *engine, const QV4::String *, bool *ok) const;-
204 int scopedEnumIndex(QQmlEnginePrivate *engine, const QString &, bool *ok) const;-
205 int scopedEnumValue(QQmlEnginePrivate *engine, int index, const QV4::String *, bool *ok) const;-
206 int scopedEnumValue(QQmlEnginePrivate *engine, int index, const QString &, bool *ok) const;-
207 int scopedEnumValue(QQmlEnginePrivate *engine, const QByteArray &, const QByteArray &, bool *ok) const;-
208 int scopedEnumValue(QQmlEnginePrivate *engine, const QStringRef &, const QStringRef &, bool *ok) const;-
209-
210 QQmlTypePrivate *priv() const { return
executed 149516 times by 44 tests: return d;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmlstatemachine
  • tst_qqmltypeloader
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickaccessible
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquickflipable
  • ...
d;
executed 149516 times by 44 tests: return d;
Executed by:
  • tst_examples
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlmetatype
  • tst_qqmlqt
  • tst_qqmlsqldatabase
  • tst_qqmlstatemachine
  • tst_qqmltypeloader
  • tst_qqmlvaluetypeproviders
  • tst_qqmlvaluetypes
  • tst_qqmlxmlhttprequest
  • tst_qquickaccessible
  • tst_qquickanimatedimage
  • tst_qquickanimationcontroller
  • tst_qquickanimations
  • tst_qquickbehaviors
  • tst_qquickdrag
  • tst_qquickdroparea
  • tst_qquickflipable
  • ...
}
149516
211 static void refHandle(QQmlTypePrivate *priv);-
212 static void derefHandle(QQmlTypePrivate *priv);-
213 static int refCount(QQmlTypePrivate *priv);-
214-
215 enum RegistrationType {-
216 CppType = 0,-
217 SingletonType = 1,-
218 InterfaceType = 2,-
219 CompositeType = 3,-
220 CompositeSingletonType = 4,-
221 AnyRegistrationType = 255-
222 };-
223-
224private:-
225 QQmlType superType() const;-
226 QQmlType resolveCompositeBaseType(QQmlEnginePrivate *engine) const;-
227 int resolveCompositeEnumValue(QQmlEnginePrivate *engine, const QString &name, bool *ok) const;-
228 QQmlPropertyCache *compositePropertyCache(QQmlEnginePrivate *engine) const;-
229 friend class QQmlTypePrivate;-
230-
231 friend QString registrationTypeString(RegistrationType);-
232 friend bool checkRegistration(RegistrationType, QQmlMetaTypeData *, const char *, const QString &, int);-
233 friend QQmlType registerType(const QQmlPrivate::RegisterType &);-
234 friend QQmlType registerSingletonType(const QQmlPrivate::RegisterSingletonType &);-
235 friend QQmlType registerInterface(const QQmlPrivate::RegisterInterface &);-
236 friend int registerQmlUnitCacheHook(const QQmlPrivate::RegisterQmlUnitCacheHook &);-
237 friend uint qHash(const QQmlType &t, uint seed);-
238 friend __attribute__((visibility("default"))) void qmlClearTypeRegistrations();-
239 friend class QQmlMetaType;-
240-
241 QQmlType(QQmlMetaTypeData *data, const QQmlPrivate::RegisterInterface &);-
242 QQmlType(QQmlMetaTypeData *data, const QString &, const QQmlPrivate::RegisterSingletonType &);-
243 QQmlType(QQmlMetaTypeData *data, const QString &, const QQmlPrivate::RegisterType &);-
244 QQmlType(QQmlMetaTypeData *data, const QString &, const QQmlPrivate::RegisterCompositeType &);-
245 QQmlType(QQmlMetaTypeData *data, const QString &, const QQmlPrivate::RegisterCompositeSingletonType &);-
246-
247 QQmlTypePrivate *d;-
248};-
249-
250template<> class QTypeInfo<QQmlMetaType > { public: enum { isSpecialized = true, isComplex = (((Q_MOVABLE_TYPE) & Q_PRIMITIVE_TYPE) == 0), isStatic = (((Q_MOVABLE_TYPE) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), isRelocatable = !isStatic || ((Q_MOVABLE_TYPE) & Q_RELOCATABLE_TYPE), isLarge = (sizeof(QQmlMetaType)>sizeof(void*)), isPointer = false, isIntegral = std::is_integral< QQmlMetaType >::value, isDummy = (((Q_MOVABLE_TYPE) & Q_DUMMY_TYPE) != 0), sizeOf = sizeof(QQmlMetaType) }; static inline const char *name() { return "QQmlMetaType"; } };-
251-
252-
253inline uint qHash(const QQmlType &t, uint seed = 0) { return
never executed: return qHash(reinterpret_cast<quintptr>(t.d), seed);
qHash(reinterpret_cast<quintptr>(t.d), seed);
never executed: return qHash(reinterpret_cast<quintptr>(t.d), seed);
}
0
254-
255-
256class QQmlTypeModulePrivate;-
257class QQmlTypeModule-
258{-
259public:-
260 QString module() const;-
261 int majorVersion() const;-
262-
263 int minimumMinorVersion() const;-
264 int maximumMinorVersion() const;-
265-
266 QQmlType type(const QHashedStringRef &, int) const;-
267 QQmlType type(const QV4::String *, int) const;-
268-
269 void walkCompositeSingletons(const std::function<void(const QQmlType &)> &callback) const;-
270-
271 QQmlTypeModulePrivate *priv() { return
never executed: return d;
d;
never executed: return d;
}
0
272private:-
273-
274 friend QQmlTypeModule *getTypeModule(const QHashedString &uri, int majorVersion, QQmlMetaTypeData *data);-
275 friend void addTypeToData(QQmlTypePrivate *type, QQmlMetaTypeData *data);-
276 friend struct QQmlMetaTypeData;-
277 friend __attribute__((visibility("default"))) void qmlClearTypeRegistrations();-
278 friend class QQmlTypeModulePrivate;-
279-
280 QQmlTypeModule();-
281 ~QQmlTypeModule();-
282 QQmlTypeModulePrivate *d;-
283};-
284-
285class QQmlTypeModuleVersion-
286{-
287public:-
288 QQmlTypeModuleVersion();-
289 QQmlTypeModuleVersion(QQmlTypeModule *, int);-
290 QQmlTypeModuleVersion(const QQmlTypeModuleVersion &);-
291 QQmlTypeModuleVersion &operator=(const QQmlTypeModuleVersion &);-
292-
293 QQmlTypeModule *module() const;-
294 int minorVersion() const;-
295-
296 QQmlType type(const QHashedStringRef &) const;-
297 QQmlType type(const QV4::String *) const;-
298-
299private:-
300 QQmlTypeModule *m_module;-
301 int m_minor;-
302};-
303-
304class __attribute__((visibility("default"))) QQmlMetaTypeRegistrationFailureRecorder-
305{-
306 QStringList _failures;-
307-
308public:-
309 QQmlMetaTypeRegistrationFailureRecorder();-
310 ~QQmlMetaTypeRegistrationFailureRecorder();-
311-
312 QStringList failures() const-
313 { return
executed 592 times by 136 tests: return _failures;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • ...
_failures;
executed 592 times by 136 tests: return _failures;
Executed by:
  • tst_bindingdependencyapi
  • tst_drawingmodes
  • tst_examples
  • tst_flickableinterop
  • tst_multipointtoucharea_interop
  • tst_parserstress
  • tst_qmlcachegen
  • tst_qmldiskcache
  • tst_qqmlbinding
  • tst_qqmlcomponent
  • tst_qqmlconnections
  • tst_qqmlconsole
  • tst_qqmlcontext
  • tst_qqmldebugjs
  • tst_qqmlecmascript
  • tst_qqmlenginecleanup
  • tst_qqmlenginedebugservice
  • tst_qqmlexpression
  • tst_qqmlimport
  • tst_qqmlincubator
  • tst_qqmlinfo
  • tst_qqmlinstantiator
  • tst_qqmllistmodel
  • tst_qqmllistmodelworkerscript
  • tst_qqmllistreference
  • ...
}
592
314};-
315-
316-
Switch to Source codePreprocessed file

Generated by Squish Coco 4.2.0