Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qqmljsscope_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3// Qt-Security score:significant
4
5#ifndef QQMLJSSCOPE_P_H
6#define QQMLJSSCOPE_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17
18#include <qtqmlcompilerexports.h>
19
25#include "qqmlsa_p.h"
26
27#include <QtQml/private/qqmljssourcelocation_p.h>
28
29#include <QtCore/qfileinfo.h>
30#include <QtCore/qhash.h>
31#include <QtCore/qset.h>
32#include <QtCore/qstring.h>
33
35
36#include <QtCore/qtyperevision.h>
37
38#include <optional>
39
40QT_BEGIN_NAMESPACE
41
42class QQmlJSImporter;
43
44namespace QQmlJS {
45
47
48class Export {
49public:
50 Export() = default;
51 Export(QString package, QString type, QTypeRevision version, QTypeRevision revision);
52
53 bool isValid() const;
54
55 QString package() const { return m_package; }
56 QString type() const { return m_type; }
57 QTypeRevision version() const { return m_version; }
58 QTypeRevision revision() const { return m_revision; }
59
60private:
61 QString m_package;
62 QString m_type;
63 QTypeRevision m_version;
64 QTypeRevision m_revision;
65};
66
67template<typename Pointer>
69 Pointer scope;
71};
72
73template<typename Pointer>
78
79struct ContextualTypes;
80
81} // namespace QQmlJS
82
83class Q_QMLCOMPILER_EXPORT QQmlJSScope
84{
85 friend QQmlSA::Element;
86
87public:
88 using Ptr = QDeferredSharedPointer<QQmlJSScope>;
89 using WeakPtr = QDeferredWeakPointer<QQmlJSScope>;
90 using ConstPtr = QDeferredSharedPointer<const QQmlJSScope>;
91 using WeakConstPtr = QDeferredWeakPointer<const QQmlJSScope>;
92
93 using AccessSemantics = QQmlSA::AccessSemantics;
94 using ScopeType = QQmlSA::ScopeType;
95
96 using InlineComponentNameType = QString;
97 using RootDocumentNameType = std::monostate; // an empty type that has std::hash
98 /*!
99 * A Hashable type to differentiate document roots from different inline components.
100 */
101 using InlineComponentOrDocumentRootName =
102 std::variant<InlineComponentNameType, RootDocumentNameType>;
103
104 enum Flag {
105 Creatable = 0x1,
106 Composite = 0x2,
107 JavaScriptBuiltin = 0x4,
108 Singleton = 0x8,
109 Script = 0x10,
110 CustomParser = 0x20,
111 Array = 0x40,
112 InlineComponent = 0x80,
113 WrappedInImplicitComponent = 0x100,
114 HasBaseTypeError = 0x200,
115 ExtensionIsNamespace = 0x400,
116 IsListProperty = 0x800,
117 Structured = 0x1000,
118 ExtensionIsJavaScript = 0x2000,
119 EnforcesScopedEnums = 0x4000,
120 FileRootComponent = 0x8000,
121 AssignedToUnknownProperty = 0x10000,
122 IsSelfExtension = 0x20000,
123 IsOpaque = 0x40000,
124 };
125 Q_DECLARE_FLAGS(Flags, Flag)
126
127 using Export = QQmlJS::Export;
128 template <typename Pointer>
129 using ImportedScope = QQmlJS::ImportedScope<Pointer>;
130 template <typename Pointer>
131 using ExportedScope = QQmlJS::ExportedScope<Pointer>;
132
133 struct JavaScriptIdentifier
134 {
135 enum Kind {
136 Parameter,
137 FunctionScoped,
138 LexicalScoped,
139 Injected
140 };
141
142 Kind kind = FunctionScoped;
143 QQmlJS::SourceLocation location;
144 std::optional<QString> typeName;
145 bool isConst = false;
146 QQmlJSScope::WeakConstPtr scope = {};
147 };
148
149 enum BindingTargetSpecifier {
150 SimplePropertyTarget, // e.g. `property int p: 42`
151 ListPropertyTarget, // e.g. `property list<Item> pList: [ Text {} ]`
152 UnnamedPropertyTarget // default property bindings, where property name is unspecified
153 };
154
155 template <typename Key, typename Value>
156 using QMultiHashRange = std::pair<typename QMultiHash<Key, Value>::iterator,
157 typename QMultiHash<Key, Value>::iterator>;
158
159 static QQmlJSScope::Ptr create() { return QSharedPointer<QQmlJSScope>(new QQmlJSScope); }
160 static QQmlJSScope::Ptr resetForReparse(QQmlJSScope::Ptr &&scope);
161
162 static QQmlJSScope::ConstPtr findCurrentQMLScope(const QQmlJSScope::ConstPtr &scope);
163
164 QQmlJSScope::Ptr parentScope();
165 QQmlJSScope::ConstPtr parentScope() const;
166 static void reparent(const QQmlJSScope::Ptr &parentScope, const QQmlJSScope::Ptr &childScope);
167
168 void insertJSIdentifier(const QString &name, const JavaScriptIdentifier &identifier);
169 QHash<QString, JavaScriptIdentifier> ownJSIdentifiers() const;
170
171 ScopeType scopeType() const { return m_scopeType; }
172 void setScopeType(ScopeType type) { m_scopeType = type; }
173
174 void addOwnMethod(const QQmlJSMetaMethod &method) { m_methods.insert(method.methodName(), method); }
175 QMultiHashRange<QString, QQmlJSMetaMethod> mutableOwnMethodsRange(const QString &name)
176 {
177 return m_methods.equal_range(name);
178 }
179 QMultiHash<QString, QQmlJSMetaMethod> ownMethods() const { return m_methods; }
180 QList<QQmlJSMetaMethod> ownMethods(const QString &name) const { return m_methods.values(name); }
181 bool hasOwnMethod(const QString &name) const { return m_methods.contains(name); }
182
183 bool hasMethod(const QString &name) const;
184 QHash<QString, QQmlJSMetaMethod> methods() const;
185 QList<QQmlJSMetaMethod> methods(const QString &name) const;
186 QList<QQmlJSMetaMethod> methods(const QString &name, QQmlJSMetaMethodType type) const;
187
188 void addOwnEnumeration(const QQmlJSMetaEnum &enumeration) { m_enumerations.insert(enumeration.name(), enumeration); }
189 QHash<QString, QQmlJSMetaEnum> ownEnumerations() const { return m_enumerations; }
190 QQmlJSMetaEnum ownEnumeration(const QString &name) const { return m_enumerations.value(name); }
191 bool hasOwnEnumeration(const QString &name) const { return m_enumerations.contains(name); }
192
193 bool hasEnumeration(const QString &name) const;
194 bool hasEnumerationKey(const QString &name) const;
195 bool hasOwnEnumerationKey(const QString &name) const;
196 QQmlJSMetaEnum enumeration(const QString &name) const;
197 QHash<QString, QQmlJSMetaEnum> enumerations() const;
198
199 void setAnnotations(const QList<QQmlJSAnnotation> &annotations) { m_annotations = annotations; }
200 const QList<QQmlJSAnnotation> &annotations() const { return m_annotations; }
201
202 QString filePath() const { return m_filePath; }
203 void setFilePath(const QString &file) { m_filePath = file; }
204
205 quint32 lineNumber() const { return m_sourceLocation.startLine; }
206 void setLineNumber(quint32 lineNumber);
207
208 QString resolvedFilePath() const { return m_resolvedFilePath; }
209 void setResolvedFilePath(const QString &file) { m_resolvedFilePath = file; }
210
211 quint32 lineNumberInResolvedFile() const { return m_lineNumberInResolvedFile; }
212 void setLineNumberInResolvedFile(quint32 lineNumber);
213
214 // The name the type uses to refer to itself. Either C++ class name or base name of
215 // QML file. isComposite tells us if this is a C++ or a QML name.
216 QString internalName() const { return m_internalName; }
217 void setInternalName(const QString &internalName) { m_internalName = internalName; }
218 QString augmentedInternalName() const;
219
220 // This returns a more user readable version of internalName / baseTypeName
221 static QString prettyName(QAnyStringView name);
222
223 enum class IsComponentRoot : quint8 { No = 0, Yes, Maybe };
224 IsComponentRoot componentRootStatus() const;
225
226 void setAliases(const QStringList &aliases) { m_aliases = aliases; }
227 QStringList aliases() const { return m_aliases; }
228
229 void setInterfaceNames(const QStringList& interfaces) { m_interfaceNames = interfaces; }
230 QStringList interfaceNames() const { return m_interfaceNames; }
231
232 bool hasInterface(const QString &name) const;
233 bool hasOwnInterface(const QString &name) const { return m_interfaceNames.contains(name); }
234
235 void setOwnDeferredNames(const QStringList &names) { m_ownDeferredNames = names; }
236 QStringList ownDeferredNames() const { return m_ownDeferredNames; }
237 void setOwnImmediateNames(const QStringList &names) { m_ownImmediateNames = names; }
238 QStringList ownImmediateNames() const { return m_ownImmediateNames; }
239
240 bool isNameDeferred(const QString &name) const;
241
242 // If isComposite(), this is the QML/JS name of the prototype. Otherwise it's the
243 // relevant base class (in the hierarchy starting from QObject) of a C++ type.
244 void setBaseTypeName(const QString &baseTypeName);
245 QString baseTypeName() const;
246
247 QQmlJSScope::ConstPtr baseType() const { return m_baseType.scope; }
248 QTypeRevision baseTypeRevision() const { return m_baseType.revision; }
249
250 QString moduleName() const;
251 QString ownModuleName() const { return m_moduleName; }
252 void setOwnModuleName(const QString &moduleName) { m_moduleName = moduleName; }
253
254 void clearBaseType() { m_baseType = {}; }
255 void setBaseTypeError(const QString &baseTypeError);
256 QString baseTypeError() const;
257
258 void addOwnProperty(const QQmlJSMetaProperty &prop) { m_properties.insert(prop.propertyName(), prop); }
259 QHash<QString, QQmlJSMetaProperty> ownProperties() const { return m_properties; }
260 QQmlJSMetaProperty ownProperty(const QString &name) const { return m_properties.value(name); }
261 bool hasOwnProperty(const QString &name) const { return m_properties.contains(name); }
262
263 bool hasProperty(const QString &name) const;
264 QQmlJSMetaProperty property(const QString &name) const;
265 QHash<QString, QQmlJSMetaProperty> properties() const;
266
267 void setPropertyLocallyRequired(const QString &name, bool isRequired);
268 bool isPropertyRequired(const QString &name) const;
269 bool isPropertyLocallyRequired(const QString &name) const;
270
271 void addOwnPropertyBinding(
272 const QQmlJSMetaPropertyBinding &binding,
273 BindingTargetSpecifier specifier = BindingTargetSpecifier::SimplePropertyTarget);
274 QMultiHash<QString, QQmlJSMetaPropertyBinding> ownPropertyBindings() const;
275 std::pair<QMultiHash<QString, QQmlJSMetaPropertyBinding>::const_iterator,
276 QMultiHash<QString, QQmlJSMetaPropertyBinding>::const_iterator>
277 ownPropertyBindings(const QString &name) const;
278 QList<QQmlJSMetaPropertyBinding> ownPropertyBindingsInQmlIROrder() const;
279 bool hasOwnPropertyBindings(const QString &name) const;
280
281 bool hasPropertyBindings(const QString &name) const;
282 QList<QQmlJSMetaPropertyBinding> propertyBindings(const QString &name) const;
283
284 struct AnnotatedScope; // defined later
285 static AnnotatedScope ownerOfProperty(const QQmlJSScope::ConstPtr &self, const QString &name);
286 static AnnotatedScope ownerOfMethod(const QQmlJSScope::ConstPtr &self, const QString &name);
287 static AnnotatedScope ownerOfEnum(const QQmlJSScope::ConstPtr &self, const QString &name);
288
289 bool isResolved() const;
290 bool isFullyResolved() const;
291
292 QString ownDefaultPropertyName() const { return m_defaultPropertyName; }
293 void setOwnDefaultPropertyName(const QString &name) { m_defaultPropertyName = name; }
294 QString defaultPropertyName() const;
295
296 QString ownParentPropertyName() const { return m_parentPropertyName; }
297 void setOwnParentPropertyName(const QString &name) { m_parentPropertyName = name; }
298 QString parentPropertyName() const;
299
300 QString ownAttachedTypeName() const { return m_attachedTypeName; }
301 void setOwnAttachedTypeName(const QString &name) { m_attachedTypeName = name; }
302 QQmlJSScope::ConstPtr ownAttachedType() const { return m_attachedType; }
303
304 QString attachedTypeName() const;
305 QQmlJSScope::ConstPtr attachedType() const;
306
307 QString extensionTypeName() const { return m_extensionTypeName; }
308 void setExtensionTypeName(const QString &name) { m_extensionTypeName = name; }
309 enum ExtensionKind {
310 NotExtension,
311 ExtensionType,
312 ExtensionJavaScript,
313 ExtensionNamespace,
314 };
315 struct AnnotatedScope
316 {
317 QQmlJSScope::ConstPtr scope;
318 ExtensionKind extensionSpecifier = NotExtension;
319 };
320 AnnotatedScope extensionType() const;
321
322 QString elementTypeName() const { return m_elementTypeName; }
323 void setElementTypeName(const QString &name) { m_elementTypeName = name; }
324 QQmlJSScope::ConstPtr elementType() const { return m_elementType; }
325 QQmlJSScope::ConstPtr listType() const { return m_listType; }
326 QQmlJSScope::Ptr listType() { return m_listType; }
327
328 void addOwnRuntimeFunctionIndex(QQmlJSMetaMethod::AbsoluteFunctionIndex index);
329 QQmlJSMetaMethod::AbsoluteFunctionIndex
330 ownRuntimeFunctionIndex(QQmlJSMetaMethod::RelativeFunctionIndex index) const;
331
332
333 /*!
334 * \internal
335 *
336 * Returns true for objects defined from Qml, and false for objects declared from C++.
337 */
338 bool isComposite() const { return m_flags.testFlag(Composite); }
339 void setIsComposite(bool v) { m_flags.setFlag(Composite, v); }
340
341 /*!
342 * \internal
343 *
344 * Returns true for JavaScript types, false for QML and C++ types.
345 */
346 bool isJavaScriptBuiltin() const { return m_flags.testFlag(JavaScriptBuiltin); }
347 void setIsJavaScriptBuiltin(bool v) { m_flags.setFlag(JavaScriptBuiltin, v); }
348
349 //!\internal True iff type was registered only because it appears in a property
350 bool isOpaqueType() const { return m_flags.testFlag(IsOpaque); }
351 void setIsTypeOpaque(bool v) { m_flags.setFlag(IsOpaque, v); }
352
353 bool isScript() const { return m_flags.testFlag(Script); }
354 void setIsScript(bool v) { m_flags.setFlag(Script, v); }
355
356 bool hasCustomParser() const { return m_flags.testFlag(CustomParser); }
357 void setHasCustomParser(bool v) { m_flags.setFlag(CustomParser, v); }
358
359 bool isArrayScope() const { return m_flags.testFlag(Array); }
360 void setIsArrayScope(bool v) { m_flags.setFlag(Array, v); }
361
362 bool isInlineComponent() const { return m_flags.testFlag(InlineComponent); }
363 void setIsInlineComponent(bool v) { m_flags.setFlag(InlineComponent, v); }
364
365 bool isWrappedInImplicitComponent() const { return m_flags.testFlag(WrappedInImplicitComponent); }
366 void setIsWrappedInImplicitComponent(bool v) { m_flags.setFlag(WrappedInImplicitComponent, v); }
367
368 bool isAssignedToUnknownProperty() const { return m_flags.testFlag(AssignedToUnknownProperty); }
369 void setAssignedToUnknownProperty(bool v) { m_flags.setFlag(AssignedToUnknownProperty, v); }
370
371 bool extensionIsJavaScript() const { return m_flags.testFlag(ExtensionIsJavaScript); }
372 void setExtensionIsJavaScript(bool v) { m_flags.setFlag(ExtensionIsJavaScript, v); }
373
374 bool extensionIsNamespace() const { return m_flags.testFlag(ExtensionIsNamespace); }
375 void setExtensionIsNamespace(bool v) { m_flags.setFlag(ExtensionIsNamespace, v); }
376
377 bool isListProperty() const { return m_flags.testFlag(IsListProperty); }
378 void setIsListProperty(bool v) { m_flags.setFlag(IsListProperty, v); }
379
380 bool isSingleton() const { return m_flags.testFlag(Singleton); }
381 void setIsSingleton(bool v) { m_flags.setFlag(Singleton, v); }
382
383 bool enforcesScopedEnums() const;
384 void setEnforcesScopedEnumsFlag(bool v) { m_flags.setFlag(EnforcesScopedEnums, v); }
385
386 bool isCreatable() const;
387 void setCreatableFlag(bool v) { m_flags.setFlag(Creatable, v); }
388
389 bool isStructured() const;
390 void setStructuredFlag(bool v) { m_flags.setFlag(Structured, v); }
391
392 bool isFileRootComponent() const { return m_flags.testFlag(FileRootComponent); }
393 void setIsRootFileComponentFlag(bool v) { m_flags.setFlag(FileRootComponent, v); }
394
395 // Self-extension happens when a type declares itself as its own extension type using the
396 // QML_EXTENDED macro. Internally, we use the self-extension + QML_FOREIGN trick to indicate
397 // the type to be used in the generated code is the declared foreign type instead of the type
398 // itself, but that the metaObject to be used is that of the extension. This is used for example
399 // with value types for types that don't have a metaObject, such as QQmlRectValueType: The
400 // generated C++ code needs to use QRect but all the properties are defined on
401 // QQmlRectValueType.
402 bool isSelfExtension() const { return m_flags.testFlag(IsSelfExtension); }
403 void setIsSelfExtension(bool v) { m_flags.setFlag(IsSelfExtension, v); }
404
405 void setAccessSemantics(AccessSemantics semantics) { m_semantics = semantics; }
406 AccessSemantics accessSemantics() const { return m_semantics; }
407 bool isReferenceType() const { return m_semantics == QQmlJSScope::AccessSemantics::Reference; }
408 bool isValueType() const { return m_semantics == QQmlJSScope::AccessSemantics::Value; }
409
410 std::optional<JavaScriptIdentifier> jsIdentifier(const QString &id) const;
411 std::optional<JavaScriptIdentifier> ownJSIdentifier(const QString &id) const;
412
413 QQmlJS::ChildScopesIterator childScopesBegin() const { return m_childScopes.constBegin(); }
414 QQmlJS::ChildScopesIterator childScopesEnd() const { return m_childScopes.constEnd(); }
415
416 void setInlineComponentName(const QString &inlineComponentName);
417 std::optional<QString> inlineComponentName() const;
418 InlineComponentOrDocumentRootName enclosingInlineComponentName() const;
419
420 QList<QQmlJSScope::Ptr> childScopes();
421
422 QList<QQmlJSScope::ConstPtr> childScopes() const;
423
424 static QTypeRevision resolveTypes(
425 const Ptr &self, const QQmlJS::ContextualTypes &contextualTypes,
426 QSet<QString> *usedTypes = nullptr);
427 static void resolveNonEnumTypes(
428 const QQmlJSScope::Ptr &self, const QQmlJS::ContextualTypes &contextualTypes,
429 QSet<QString> *usedTypes = nullptr);
430 static void resolveEnums(
431 const QQmlJSScope::Ptr &self, const QQmlJS::ContextualTypes &contextualTypes,
432 QSet<QString> *usedTypes = nullptr);
433 static void resolveList(
434 const QQmlJSScope::Ptr &self, const QQmlJSScope::ConstPtr &arrayType);
435 static void resolveGroup(
436 const QQmlJSScope::Ptr &self, const QQmlJSScope::ConstPtr &baseType,
437 const QQmlJS::ContextualTypes &contextualTypes,
438 QSet<QString> *usedTypes = nullptr);
439
440 void setSourceLocation(const QQmlJS::SourceLocation &sourceLocation);
441 QQmlJS::SourceLocation sourceLocation() const;
442
443 void setIdSourceLocation(const QQmlJS::SourceLocation &sourceLocation);
444 QQmlJS::SourceLocation idSourceLocation() const;
445
446 static QQmlJSScope::ConstPtr nonCompositeBaseType(const QQmlJSScope::ConstPtr &type);
447
448 static QTypeRevision
449 nonCompositeBaseRevision(const ImportedScope<QQmlJSScope::ConstPtr> &scope);
450
451 bool isSameType(const QQmlJSScope::ConstPtr &otherScope) const;
452 bool inherits(const QQmlJSScope::ConstPtr &base) const;
453 bool canAssign(const QQmlJSScope::ConstPtr &derived) const;
454
455 bool isInCustomParserParent() const;
456
457
458 static ImportedScope<QQmlJSScope::ConstPtr> findType(const QString &name,
459 const QQmlJS::ContextualTypes &contextualTypes,
460 QSet<QString> *usedTypes = nullptr);
461
462 static QQmlSA::Element createQQmlSAElement(const ConstPtr &);
463 static QQmlSA::Element createQQmlSAElement(ConstPtr &&);
464 static const QQmlJSScope::ConstPtr &scope(const QQmlSA::Element &);
465 static constexpr qsizetype sizeofQQmlSAElement() { return QQmlSA::Element::sizeofElement; }
466
467private:
468 // the way to construct a QQmlJSScope is via create
469 explicit QQmlJSScope(const QString &internalName);
470 QQmlJSScope(QQmlJSScope &&) = default;
471 QQmlJSScope &operator=(QQmlJSScope &&) = default;
472 /*! \internal
473
474 Minimal information about a QQmlJSMetaPropertyBinding that allows it to
475 be manipulated similarly to QmlIR::Binding.
476 */
477 template <typename T>
478 friend class QTypeInfo; // so that we can Q_DECLARE_TYPEINFO QmlIRCompatibilityBindingData
479 struct QmlIRCompatibilityBindingData
480 {
481 QmlIRCompatibilityBindingData() = default;
482 QmlIRCompatibilityBindingData(const QString &name, quint32 offset)
483 : propertyName(name), sourceLocationOffset(offset)
484 {
485 }
486 QString propertyName; // bound property name
487 quint32 sourceLocationOffset = 0; // binding's source location offset
488 };
489
490 QQmlJSScope() = default;
491 QQmlJSScope(const QQmlJSScope &) = default;
492 QQmlJSScope &operator=(const QQmlJSScope &) = default;
493 static QTypeRevision resolveType(
494 const QQmlJSScope::Ptr &self, const QQmlJS::ContextualTypes &contextualTypes,
495 QSet<QString> *usedTypes);
496 static void updateChildScope(
497 const QQmlJSScope::Ptr &childScope, const QQmlJSScope::Ptr &self,
498 const QQmlJS::ContextualTypes &contextualTypes, QSet<QString> *usedTypes);
499
500 void addOwnPropertyBindingInQmlIROrder(const QQmlJSMetaPropertyBinding &binding,
501 BindingTargetSpecifier specifier);
502 bool hasEnforcesScopedEnumsFlag() const { return m_flags & EnforcesScopedEnums; }
503 bool hasCreatableFlag() const { return m_flags & Creatable; }
504 bool hasStructuredFlag() const { return m_flags & Structured; }
505
506 QHash<QString, JavaScriptIdentifier> m_jsIdentifiers;
507
508 QMultiHash<QString, QQmlJSMetaMethod> m_methods;
509 QHash<QString, QQmlJSMetaProperty> m_properties;
510 QMultiHash<QString, QQmlJSMetaPropertyBinding> m_propertyBindings;
511
512 // a special QmlIR compatibility bindings array, ordered the same way as
513 // bindings in QmlIR::Object
514 QList<QmlIRCompatibilityBindingData> m_propertyBindingsArray;
515
516 // same as QmlIR::Object::runtimeFunctionIndices
517 QList<QQmlJSMetaMethod::AbsoluteFunctionIndex> m_runtimeFunctionIndices;
518
519 QHash<QString, QQmlJSMetaEnum> m_enumerations;
520
521 QList<QQmlJSAnnotation> m_annotations;
522 QList<QQmlJSScope::Ptr> m_childScopes;
523 QQmlJSScope::WeakPtr m_parentScope;
524
525 QString m_filePath;
526 QString m_resolvedFilePath;
527 QString m_internalName;
528 QString m_baseTypeNameOrError;
529
530 // We only need the revision for the base type as inheritance is
531 // the only relation between two types where the revisions matter.
532 ImportedScope<QQmlJSScope::WeakConstPtr> m_baseType;
533
534 ScopeType m_scopeType = ScopeType::QMLScope;
535 QStringList m_aliases;
536 QStringList m_interfaceNames;
537 QStringList m_ownDeferredNames;
538 QStringList m_ownImmediateNames;
539
540 QString m_defaultPropertyName;
541 QString m_parentPropertyName;
542 /*! \internal
543 * The attached type name.
544 * This is an internal name, from a c++ type or a synthetic jsrootgen.
545 */
546 QString m_attachedTypeName;
547 QStringList m_requiredPropertyNames;
548 QQmlJSScope::WeakConstPtr m_attachedType;
549
550 /*! \internal
551 * The type name of the list element in case this is a sequence type.
552 * This is an internal name, from a c++ type or a synthetic jsrootgen.
553 */
554 QString m_elementTypeName;
555 QQmlJSScope::WeakConstPtr m_elementType;
556 QQmlJSScope::Ptr m_listType;
557
558 /*!
559 The extension is provided as either a type (QML_{NAMESPACE_}EXTENDED) or as a
560 namespace (QML_EXTENDED_NAMESPACE).
561 The bool HasExtensionNamespace helps differentiating both cases, as namespaces
562 have a more limited lookup capaility.
563 This is an internal name, from a c++ type or a synthetic jsrootgen.
564 */
565 QString m_extensionTypeName;
566 QQmlJSScope::WeakConstPtr m_extensionType;
567
568 Flags m_flags = Creatable; // all types are marked as creatable by default.
569 AccessSemantics m_semantics = AccessSemantics::Reference;
570
571 QQmlJS::SourceLocation m_sourceLocation;
572 QQmlJS::SourceLocation m_idSourceLocation;
573
574 QString m_moduleName;
575
576 std::optional<QString> m_inlineComponentName;
577
578 quint32 m_lineNumberInResolvedFile = 0;
579};
580
581inline QQmlJSScope::Ptr QQmlJSScope::parentScope()
582{
583 return m_parentScope.toStrongRef();
584}
585
586inline QQmlJSScope::ConstPtr QQmlJSScope::parentScope() const
587{
588 QT_WARNING_PUSH
589#if defined(Q_CC_GNU_ONLY) && Q_CC_GNU < 1400 && Q_CC_GNU >= 1200
590 QT_WARNING_DISABLE_GCC("-Wuse-after-free")
591#endif
592 return QQmlJSScope::WeakConstPtr(m_parentScope).toStrongRef();
593 QT_WARNING_POP
594}
595
596inline QMultiHash<QString, QQmlJSMetaPropertyBinding> QQmlJSScope::ownPropertyBindings() const
597{
598 return m_propertyBindings;
599}
600
601inline std::pair<QMultiHash<QString, QQmlJSMetaPropertyBinding>::const_iterator, QMultiHash<QString, QQmlJSMetaPropertyBinding>::const_iterator> QQmlJSScope::ownPropertyBindings(const QString &name) const
602{
603 return m_propertyBindings.equal_range(name);
604}
605
606inline bool QQmlJSScope::hasOwnPropertyBindings(const QString &name) const
607{
608 return m_propertyBindings.contains(name);
609}
610
611inline QQmlJSMetaMethod::AbsoluteFunctionIndex QQmlJSScope::ownRuntimeFunctionIndex(QQmlJSMetaMethod::RelativeFunctionIndex index) const
612{
613 const int i = static_cast<int>(index);
614 Q_ASSERT(i >= 0);
615 Q_ASSERT(i < int(m_runtimeFunctionIndices.size()));
616 return m_runtimeFunctionIndices[i];
617}
618
619inline void QQmlJSScope::setInlineComponentName(const QString &inlineComponentName)
620{
621 Q_ASSERT(isInlineComponent());
622 m_inlineComponentName = inlineComponentName;
623}
624
625inline QList<QQmlJSScope::Ptr> QQmlJSScope::childScopes()
626{
627 return m_childScopes;
628}
629
630inline void QQmlJSScope::setSourceLocation(const QQmlJS::SourceLocation &sourceLocation)
631{
632 m_sourceLocation = sourceLocation;
633}
634
635inline QQmlJS::SourceLocation QQmlJSScope::sourceLocation() const
636{
637 return m_sourceLocation;
638}
639
640inline void QQmlJSScope::setIdSourceLocation(const QQmlJS::SourceLocation &sourceLocation)
641{
642 Q_ASSERT(m_scopeType == QQmlSA::ScopeType::QMLScope);
643 m_idSourceLocation = sourceLocation;
644}
645
646inline QQmlJS::SourceLocation QQmlJSScope::idSourceLocation() const
647{
648 Q_ASSERT(m_scopeType == QQmlSA::ScopeType::QMLScope);
649 return m_idSourceLocation;
650}
651
652inline QQmlJSScope::ConstPtr QQmlJSScope::nonCompositeBaseType(const ConstPtr &type)
653{
654 for (QQmlJSScope::ConstPtr base = type; base; base = base->baseType()) {
655 if (!base->isComposite())
656 return base;
657 }
658 return {};
659}
660
662
663template<>
664class Q_QMLCOMPILER_EXPORT QDeferredFactory<QQmlJSScope>
665{
666public:
667 QDeferredFactory() = default;
668
669 QDeferredFactory(QQmlJSImporter *importer, const QQmlJS::TypeReader &typeReader,
670 const QString &filePath, const QString &moduleName, bool isSingleton);
671
672 bool isValid() const
673 {
674 return !m_filePath.isEmpty() && m_importer != nullptr;
675 }
676
677 QString internalName() const
678 {
679 return QFileInfo(m_filePath).baseName();
680 }
681
682 QString filePath() const { return m_filePath; }
683
684 QQmlJSImporter* importer() const { return m_importer; }
685 QString moduleName() const { return m_moduleName; }
686 bool isSingleton() const { return m_isSingleton; }
687
688 void setIsSingleton(bool isSingleton)
689 {
690 m_isSingleton = isSingleton;
691 }
692
693 void setModuleName(const QString &moduleName) { m_moduleName = moduleName; }
694
695private:
696 friend class QDeferredSharedPointer<QQmlJSScope>;
697 friend class QDeferredSharedPointer<const QQmlJSScope>;
698 friend class QDeferredWeakPointer<QQmlJSScope>;
699 friend class QDeferredWeakPointer<const QQmlJSScope>;
700
701 // Should only be called when lazy-loading the type in a deferred pointer.
702 void populate(const QSharedPointer<QQmlJSScope> &scope) const;
703
704 QQmlJSImporter *m_importer = nullptr;
705 QQmlJS::TypeReader m_typeReader;
706 QString m_filePath;
707 QString m_moduleName;
708 bool m_isSingleton = false;
709};
710
711using QQmlJSExportedScope = QQmlJSScope::ExportedScope<QQmlJSScope::Ptr>;
712using QQmlJSImportedScope = QQmlJSScope::ImportedScope<QQmlJSScope::ConstPtr>;
713
714namespace QQmlSA {
715constexpr inline bool isFunctionScope(ScopeType type)
716{
717 switch (type) {
721 return true;
722 default:
723 return false;
724 }
725}
726
727}
728
729template <typename T>
730static void resetFactory(QDeferredSharedPointer<T> &pointer, QQmlJSImporter *importer,
731 const QQmlJS::TypeReader &typeReader, const QString &filePath)
732{
733 const auto &factory = pointer.factory();
734 QDeferredFactory<std::remove_const_t<T>> newFactory(importer,
735 typeReader, filePath,
736 factory ? factory->moduleName() : QString(),
737 factory ? factory->isSingleton() : false);
738 return resetFactoryImpl(pointer, std::move(newFactory));
739}
740
741template<typename T, typename U>
742void resetFactoryImpl(QDeferredSharedPointer<T> &pointer, U&& factory)
743{
744 pointer.m_data.reset();
745 *pointer.m_factory = std::forward<U>(factory);
746}
747
748
749QT_END_NAMESPACE
750
751#endif // QQMLJSSCOPE_P_H
friend bool operator==(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) noexcept
Returns true if lhs and rhs are equal, otherwise returns false.
Definition qbytearray.h:803
friend bool operator!=(const QByteArray::FromBase64Result &lhs, const QByteArray::FromBase64Result &rhs) noexcept
Returns true if lhs and rhs are different, otherwise returns false.
Definition qbytearray.h:814
QString fileName() const
If the currently assigned device is a QFile, or if setFileName() has been called, this function retur...
void setFileName(const QString &fileName)
Sets the file name of QImageReader to fileName.
virtual Type type() const =0
Reimplement this function to return the paint engine \l{Type}.
virtual bool isValid() const
virtual QString location() const
QString typeName() const
void setIsFlag(bool isFlag)
void setLineNumber(int lineNumber)
friend bool operator!=(const QQmlJSMetaEnum &a, const QQmlJSMetaEnum &b)
void setName(const QString &name)
QQmlJSMetaEnum()=default
int lineNumber() const
friend size_t qHash(const QQmlJSMetaEnum &e, size_t seed=0)
friend bool operator==(const QQmlJSMetaEnum &a, const QQmlJSMetaEnum &b)
void setTypeName(const QString &typeName)
bool hasKey(const QString &key) const
void setIsScoped(bool v)
void setType(const QSharedPointer< const QQmlJSScope > &type)
QSharedPointer< const QQmlJSScope > type() const
int value(const QString &key) const
bool isQml() const
void setIsQml(bool v)
void addValue(int value)
bool isScoped() const
QList< int > values() const
bool isFlag() const
QString alias() const
QStringList keys() const
bool isValid() const
void addKey(const QString &key)
void setAlias(const QString &alias)
QString name() const
QQmlJSMetaEnum(QString name)
bool hasValues() const
QQmlJSMetaReturnType returnValue() const
QQmlJSMetaMethod()=default
void setReturnType(QWeakPointer< const QQmlJSScope > type)
void setSourceLocation(QQmlJS::SourceLocation location)
QQmlJS::SourceLocation sourceLocation() const
QString methodName() const
QQmlJSMetaMethodType MethodType
void setMethodName(const QString &name)
void setReturnTypeName(const QString &typeName)
QString returnTypeName() const
QQmlJSMetaMethod(QString name, QString returnType=QString())
QList< QQmlJSMetaParameter > parameters() const
void setReturnValue(const QQmlJSMetaReturnType returnValue)
QSharedPointer< const QQmlJSScope > returnType() const
void setIsPointer(bool isPointer)
void setType(QWeakPointer< const QQmlJSScope > type)
void setIsList(bool isList)
friend bool operator!=(const QQmlJSMetaParameter &a, const QQmlJSMetaParameter &b)
friend size_t qHash(const QQmlJSMetaParameter &e, size_t seed=0)
void setName(const QString &name)
void setTypeName(const QString &typeName)
void setTypeQualifier(Constness typeQualifier)
Constness typeQualifier() const
QString typeName() const
QQmlJSMetaParameter(QString name=QString(), QString typeName=QString(), Constness typeQualifier=NonConst, QWeakPointer< const QQmlJSScope > type={})
friend bool operator==(const QQmlJSMetaParameter &a, const QQmlJSMetaParameter &b)
QSharedPointer< const QQmlJSScope > type() const
\inmodule QtQmlCompiler
friend bool operator!=(const QQmlJSMetaProperty &a, const QQmlJSMetaProperty &b)
QString notify() const
QSharedPointer< const QQmlJSScope > aliasTargetScope() const
QString aliasExpression() const
friend bool operator==(const QQmlJSMetaProperty &a, const QQmlJSMetaProperty &b)
void setIsOverride(bool isOverride)
void setPropertyName(const QString &propertyName)
QString aliasTargetName() const
void setAnnotations(const QList< QQmlJSAnnotation > &annotation)
void setIsList(bool isList)
QString bindable() const
QSharedPointer< const QQmlJSScope > type() const
void setPrivateClass(const QString &privateClass)
void setRead(const QString &read)
friend size_t qHash(const QQmlJSMetaProperty &prop, size_t seed=0)
void setBindable(const QString &bindable)
void setWrite(const QString &write)
void setIsPropertyConstant(bool isPropertyConstant)
QString reset() const
void setRevision(int revision)
void setIsFinal(bool isFinal)
QString typeName() const
void setAliasTargetScope(const QSharedPointer< const QQmlJSScope > &scope)
void setSourceLocation(const QQmlJS::SourceLocation &newSourceLocation)
QString write() const
void setIsTypeConstant(bool isTypeConstant)
const QList< QQmlJSAnnotation > & annotations() const
QQmlJS::SourceLocation sourceLocation() const
void setTypeName(const QString &typeName)
QQmlJSMetaProperty()=default
void setReset(const QString &reset)
QString privateClass() const
void setIsVirtual(bool isVirtual)
void setIsWritable(bool isWritable)
void setAliasExpression(const QString &aliasString)
void setAliasTargetName(const QString &name)
void setIndex(int index)
void setNotify(const QString &notify)
bool isPropertyConstant() const
bool isTypeConstant() const
void setType(const QSharedPointer< const QQmlJSScope > &type)
QString propertyName() const
void setIsPointer(bool isPointer)
QQmlJSRegisterContent createMethod(const QList< QQmlJSMetaMethod > &methods, const QQmlJSScope::ConstPtr &methodType, ContentVariant variant, QQmlJSRegisterContent scope)
QQmlJSRegisterContent createImportNamespace(uint importNamespaceStringId, const QQmlJSScope::ConstPtr &importNamespaceType, ContentVariant variant, QQmlJSRegisterContent scope)
QQmlJSRegisterContent createProperty(const QQmlJSMetaProperty &property, int baseLookupIndex, int resultLookupIndex, ContentVariant variant, QQmlJSRegisterContent scope)
void adjustType(QQmlJSRegisterContent content, const QQmlJSScope::ConstPtr &adjusted)
void generalizeType(QQmlJSRegisterContent content, const QQmlJSScope::ConstPtr &generalized)
void storeType(QQmlJSRegisterContent content, const QQmlJSScope::ConstPtr &stored)
QQmlJSRegisterContent castTo(QQmlJSRegisterContent content, const QQmlJSScope::ConstPtr &newContainedType)
QQmlJSRegisterContent createEnumeration(const QQmlJSMetaEnum &enumeration, const QString &enumMember, ContentVariant variant, QQmlJSRegisterContent scope)
void setAllocationMode(AllocationMode mode)
QQmlJSRegisterContent storedIn(QQmlJSRegisterContent content, const QQmlJSScope::ConstPtr &newStoredType)
QQmlJSRegisterContent clone(QQmlJSRegisterContent from)
QQmlJSRegisterContent createType(const QQmlJSScope::ConstPtr &type, int resultLookupIndex, ContentVariant variant, QQmlJSRegisterContent scope={})
QQmlJSRegisterContent createConversion(const QList< QQmlJSRegisterContent > &origins, const QQmlJSScope::ConstPtr &conversion, QQmlJSRegisterContent conversionScope, ContentVariant variant, QQmlJSRegisterContent scope)
QQmlJSRegisterContent createMethodCall(const QQmlJSMetaMethod &method, const QQmlJSScope::ConstPtr &returnType, QQmlJSRegisterContent scope)
Tracks the types for the QmlCompiler.
QTypeRevision revision() const
QString type() const
QTypeRevision version() const
bool isValid() const
QString package() const
Export()=default
Export(QString package, QString type, QTypeRevision version, QTypeRevision revision)
virtual QQmlSourceLocation sourceLocation() const
\inmodule QtQmlCompiler
Definition qqmlsa.h:53
Element attachedType() const
Returns the attached type if the content type of this binding is AttachedProperty,...
Definition qqmlsa.cpp:384
BindingType bindingType() const
Returns the type of this binding.
Definition qqmlsa.cpp:350
Element bindingScope() const
Returns the Element scope in which the binding is defined.
Definition qqmlsa.cpp:342
friend bool operator!=(const Binding &lhs, const Binding &rhs)
Returns true if lhs and rhs are not equal, and false otherwise.
Definition qqmlsa.h:107
bool hasUndefinedScriptValue() const
Returns whether this binding has script value type undefined like when it is assigned undefined.
Definition qqmlsa.cpp:451
Binding(const Binding &)
Creates a copy of other.
Definition qqmlsa.cpp:254
Binding & operator=(const Binding &)
Assigns other to this Binding instance.
Definition qqmlsa.cpp:266
bool isAttached() const
Returns true if this type is attached to another one, false otherwise.
Definition qqmlsa.cpp:375
bool hasObject() const
Returns true if this binding has an objects, otherwise returns false.
Definition qqmlsa.cpp:432
friend bool operator==(const Binding &lhs, const Binding &rhs)
Returns true if lhs and rhs are equal, and false otherwise.
Definition qqmlsa.h:103
static bool isLiteralBinding(BindingType)
Returns true if bindingType is a literal type, and false otherwise.
Definition qqmlsa.cpp:475
QString propertyName() const
Returns the name of the property bound with this binding.
Definition qqmlsa.cpp:367
Binding()
Constructs a new Binding object.
Definition qqmlsa.cpp:247
QString stringValue() const
Returns the associated string literal if the content type of this binding is StringLiteral,...
Definition qqmlsa.cpp:359
Element objectType() const
Returns the type of the associated object if the content type of this binding is Object,...
Definition qqmlsa.cpp:441
Binding & operator=(Binding &&) noexcept
Move-assigns other to this Binding instance.
Definition qqmlsa.cpp:282
QQmlSA::SourceLocation sourceLocation() const
Returns the location in the QML code where this binding is defined.
Definition qqmlsa.cpp:405
ScriptBindingKind scriptKind() const
Returns the kind of the associated script if the content type of this binding is Script,...
Definition qqmlsa.cpp:424
double numberValue() const
Returns the associated number if the content type of this binding is NumberLiteral,...
Definition qqmlsa.cpp:415
Element groupType() const
Returns the type of the property of this binding if it is a group property, otherwise returns an inva...
Definition qqmlsa.cpp:334
bool hasFunctionScriptValue() const
Returns whether this binding has script value type function like when it is assigned a (lambda) metho...
Definition qqmlsa.cpp:464
\inmodule QtQmlCompiler
Definition qqmlsa.h:378
QString replacement() const
Returns the replacement string of the edit.
Definition qqmlsa.cpp:2123
QString filename() const
Returns the file this edit applies to.
Definition qqmlsa.cpp:2105
DocumentEdit(const DocumentEdit &)
Creates a copy of other.
Definition qqmlsa.cpp:2058
\inmodule QtQmlCompiler
Definition qqmlsa.h:369
\inmodule QtQmlCompiler
Definition qqmlsa.h:203
\inmodule QtQmlCompiler
Definition qqmlsa.h:406
FixSuggestion(const QString &description, const QQmlSA::SourceLocation &location, const QList< DocumentEdit > &documentEdits={})
Creates a FixSuggestion object.
Definition qqmlsa.cpp:2214
void addDocumentEdit(const DocumentEdit &)
Adds a document edit to the list of edits for this fix.
Definition qqmlsa.cpp:2286
FixSuggestion(const FixSuggestion &)
Creates a copy of other.
Definition qqmlsa.cpp:2223
QString description() const
Returns the description of the fix.
Definition qqmlsa.cpp:2268
bool isAutoApplicable() const
Returns whether this suggested fix can be applied automatically.
Definition qqmlsa.cpp:2330
void setAutoApplicable(bool autoApplicable=true)
Sets autoApplicable to determine whether this suggested fix can be applied automatically.
Definition qqmlsa.cpp:2321
QList< DocumentEdit > documentEdits() const
Returns the list of document edits that applying this fix would make.
Definition qqmlsa.cpp:2295
\inmodule QtQmlCompiler
Definition qqmlsa.h:284
void emitWarning(QAnyStringView diagnostic, LoggerWarningId id)
Emits a warning message diagnostic about an issue of type id.
Definition qqmlsa.cpp:1269
Element resolveLiteralType(const Binding &binding)
Returns the element representing the type of literal in binding.
Definition qqmlsa.cpp:1382
void emitWarning(QAnyStringView diagnostic, LoggerWarningId id, QQmlSA::SourceLocation srcLocation, const QQmlSA::FixSuggestion &fix)
Emits a warning message diagnostic about an issue of type id located at srcLocation and with suggeste...
Definition qqmlsa.cpp:1292
void emitWarning(QAnyStringView diagnostic, LoggerWarningId id, QQmlSA::SourceLocation srcLocation)
Emits warning message diagnostic about an issue of type id located at srcLocation.
Definition qqmlsa.cpp:1278
Element resolveBuiltinType(QAnyStringView typeName) const
Returns the type of the built-in type identified by typeName.
Definition qqmlsa.cpp:1354
Element resolveAttached(QAnyStringView moduleName, QAnyStringView typeName)
Returns the attached type of typeName defined in module moduleName.
Definition qqmlsa.cpp:1372
QString resolveElementToId(const Element &element, const Element &context)
Returns the id of element in a given context.
Definition qqmlsa.cpp:1405
Element resolveTypeInFileScope(QAnyStringView typeName)
Returns the type corresponding to typeName inside the currently analysed file.
Definition qqmlsa.cpp:1307
QString sourceCode(QQmlSA::SourceLocation location)
Returns the source code located within location.
Definition qqmlsa.cpp:1417
Element resolveAttachedInFileScope(QAnyStringView typeName)
Returns the attached type corresponding to typeName used inside the currently analysed file.
Definition qqmlsa.cpp:1319
Element resolveIdToElement(QAnyStringView id, const Element &context)
Returns the element in context that has id id.
Definition qqmlsa.cpp:1393
Element resolveType(QAnyStringView moduleName, QAnyStringView typeName)
Returns the type of typeName defined in module moduleName.
Definition qqmlsa.cpp:1337
\inmodule QtQmlCompiler
Definition qqmlsa.h:341
\inmodule QtQmlCompiler
Definition qqmlsa.h:121
Method & operator=(Method &&) noexcept
Move-assigns other to this Method instance.
Definition qqmlsa.cpp:624
MethodType methodType() const
Returns the type of this method.
Definition qqmlsa.cpp:651
Method(const Method &)
Creates a copy of other.
Definition qqmlsa.cpp:598
Method()
Constructs a new Method object.
Definition qqmlsa.cpp:593
Method & operator=(const Method &)
Assigns other to this Method instance.
Definition qqmlsa.cpp:611
QString methodName() const
Returns the name of the this method.
Definition qqmlsa.cpp:642
\inmodule QtQmlCompiler
Definition qqmlsa.h:315
void analyze(const Element &root)
Runs the element passes over root and all its children.
Definition qqmlsa.cpp:1607
bool isCategoryEnabled(LoggerWarningId category) const
Returns true if warnings of category are enabled, false otherwise.
Definition qqmlsa.cpp:1718
bool registerPropertyPass(std::shared_ptr< PropertyPass > pass, QAnyStringView moduleName, QAnyStringView typeName, QAnyStringView propertyName=QAnyStringView(), bool allowInheritance=true)
Registers a static analysis pass for properties.
Definition qqmlsa.cpp:1509
std::unordered_map< quint32, Binding > bindingsByLocation() const
Returns bindings by their source location.
Definition qqmlsa.cpp:1948
bool hasImportedModule(QAnyStringView name) const
Returns true if the module named module has been imported by the QML to be analyzed,...
Definition qqmlsa.cpp:1710
\inmodule QtQmlCompiler
Definition qqmlsa.h:352
\inmodule QtQmlCompiler
Definition qqmlsa.h:170
Property(const Property &)
Creates a copy of other.
Definition qqmlsa.cpp:779
QString typeName() const
Returns the name of the type of this property.
Definition qqmlsa.cpp:824
bool isReadonly() const
Returns true if this property is read-only, false otherwise.
Definition qqmlsa.cpp:842
\inmodule QtQmlCompiler
MethodType
Definition qqmlsa.h:49
constexpr bool isFunctionScope(ScopeType type)
AccessSemantics
Definition qqmlsa.h:50
Combined button and popup list for selecting options.
Q_DECLARE_TYPEINFO(QDateTime::Data, Q_RELOCATABLE_TYPE)
Q_DECLARE_INTERFACE(QNetworkAccessBackendFactory, QNetworkAccessBackendFactory_iid)
static QString toNumericString(double value)
static QString messageTypeForMethod(const QString &method)
static QString derefContentPointer(const QString &contentPointer)
static bool canTypeBeAffectedBySideEffects(const QQmlJSTypeResolver *typeResolver, const QQmlJSRegisterContent &baseType)
#define BYTECODE_UNIMPLEMENTED()
#define INJECT_TRACE_INFO(function)
#define REJECT
static QString registerName(int registerIndex, int offset)
static QString minExpression(int argc)
static QString maxExpression(int argc)
static bool isTypeStorable(const QQmlJSTypeResolver *resolver, const QQmlJSScope::ConstPtr &type)
QQmlSA::MethodType QQmlJSMetaMethodType
QQmlJSMetaParameter QQmlJSMetaReturnType
ScriptBindingValueType
@ ScriptValue_Function
@ ScriptValue_Unknown
@ ScriptValue_Undefined
static void resetFactory(QDeferredSharedPointer< T > &pointer, QQmlJSImporter *importer, const QQmlJS::TypeReader &typeReader, const QString &filePath)
void resetFactoryImpl(QDeferredSharedPointer< T > &pointer, U &&factory)
#define QmlLintPluginInterface_iid
Definition qqmlsa.h:450
QList< Export > exports
QTypeRevision revision