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
QQmlSA::GenericPass Class Reference

\inmodule QtQmlCompiler More...

#include <qqmlsa.h>

Inheritance diagram for QQmlSA::GenericPass:
Collaboration diagram for QQmlSA::GenericPass:

Public Member Functions

 GenericPass (PassManager *manager)
 Creates a generic pass.
virtual ~GenericPass ()
 Destroys the GenericPass instance.
void emitWarning (QAnyStringView diagnostic, LoggerWarningId id)
 Emits a warning message diagnostic about an issue of type id.
void emitWarning (QAnyStringView diagnostic, LoggerWarningId id, QQmlSA::SourceLocation srcLocation)
 Emits warning message diagnostic about an issue of type id located at srcLocation.
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 suggested fix fix.
Element resolveTypeInFileScope (QAnyStringView typeName)
 Returns the type corresponding to typeName inside the currently analysed file.
Element resolveAttachedInFileScope (QAnyStringView typeName)
 Returns the attached type corresponding to typeName used inside the currently analysed file.
Element resolveType (QAnyStringView moduleName, QAnyStringView typeName)
 Returns the type of typeName defined in module moduleName.
Element resolveBuiltinType (QAnyStringView typeName) const
 Returns the type of the built-in type identified by typeName.
Element resolveAttached (QAnyStringView moduleName, QAnyStringView typeName)
 Returns the attached type of typeName defined in module moduleName.
Element resolveLiteralType (const Binding &binding)
 Returns the element representing the type of literal in binding.
Element resolveIdToElement (QAnyStringView id, const Element &context)
 Returns the element in context that has id id.
QString resolveElementToId (const Element &element, const Element &context)
 Returns the id of element in a given context.
QString sourceCode (QQmlSA::SourceLocation location)
 Returns the source code located within location.

Detailed Description

\inmodule QtQmlCompiler

The base class for static analysis passes.

This class contains common functionality used by more specific passses. Custom passes should not directly derive from it, but rather from one of its subclasses.

See also
ElementPass, PropertyPass

Definition at line 282 of file qqmlsa.h.

Constructor & Destructor Documentation

◆ GenericPass()

QQmlSA::GenericPass::GenericPass ( PassManager * manager)

Creates a generic pass.

Definition at line 1253 of file qqmlsa.cpp.

◆ ~GenericPass()

QQmlSA::GenericPass::~GenericPass ( )
virtualdefault

Destroys the GenericPass instance.

Member Function Documentation

◆ emitWarning() [1/3]

void QQmlSA::GenericPass::emitWarning ( QAnyStringView diagnostic,
LoggerWarningId id )

Emits a warning message diagnostic about an issue of type id.

Definition at line 1264 of file qqmlsa.cpp.

◆ emitWarning() [2/3]

void QQmlSA::GenericPass::emitWarning ( QAnyStringView diagnostic,
LoggerWarningId id,
QQmlSA::SourceLocation srcLocation )

Emits warning message diagnostic about an issue of type id located at srcLocation.

Definition at line 1273 of file qqmlsa.cpp.

◆ emitWarning() [3/3]

void QQmlSA::GenericPass::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 suggested fix fix.

Definition at line 1287 of file qqmlsa.cpp.

◆ resolveAttached()

Element QQmlSA::GenericPass::resolveAttached ( QAnyStringView moduleName,
QAnyStringView typeName )

Returns the attached type of typeName defined in module moduleName.

Definition at line 1366 of file qqmlsa.cpp.

◆ resolveAttachedInFileScope()

Element QQmlSA::GenericPass::resolveAttachedInFileScope ( QAnyStringView typeName)

Returns the attached type corresponding to typeName used inside the currently analysed file.

Definition at line 1314 of file qqmlsa.cpp.

◆ resolveBuiltinType()

Element QQmlSA::GenericPass::resolveBuiltinType ( QAnyStringView typeName) const

Returns the type of the built-in type identified by typeName.

Built-in types encompass {C++} types which the QML engine can handle without any imports (e.g. \l QDateTime and \l QString), global EcmaScript objects like Number, as well as the \l {QML Global Object} {global Qt object}.

Definition at line 1348 of file qqmlsa.cpp.

◆ resolveElementToId()

QString QQmlSA::GenericPass::resolveElementToId ( const Element & element,
const Element & context )

Returns the id of element in a given context.

Definition at line 1399 of file qqmlsa.cpp.

◆ resolveIdToElement()

Element QQmlSA::GenericPass::resolveIdToElement ( QAnyStringView id,
const Element & context )

Returns the element in context that has id id.

Definition at line 1387 of file qqmlsa.cpp.

◆ resolveLiteralType()

Element QQmlSA::GenericPass::resolveLiteralType ( const Binding & binding)

Returns the element representing the type of literal in binding.

If the binding does not contain a literal value, a null Element is returned.

Definition at line 1376 of file qqmlsa.cpp.

◆ resolveType()

Element QQmlSA::GenericPass::resolveType ( QAnyStringView moduleName,
QAnyStringView typeName )

Returns the type of typeName defined in module moduleName.

If an attached type and a non-attached type share the same name (for example, ListView), the \l Element corresponding to the non-attached type is returned. To obtain the attached type, use \l resolveAttached.

Definition at line 1332 of file qqmlsa.cpp.

◆ resolveTypeInFileScope()

Element QQmlSA::GenericPass::resolveTypeInFileScope ( QAnyStringView typeName)

Returns the type corresponding to typeName inside the currently analysed file.

Definition at line 1302 of file qqmlsa.cpp.

◆ sourceCode()

QString QQmlSA::GenericPass::sourceCode ( QQmlSA::SourceLocation location)

Returns the source code located within location.

Definition at line 1411 of file qqmlsa.cpp.


The documentation for this class was generated from the following files: