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
qqmljsimportvisitor.cpp File Reference

(46925f589fadf9f16c4db2462e086f28a104f629)

#include "qqmljsimportvisitor_p.h"
#include "qqmljslogger_p.h"
#include "qqmljsmetatypes_p.h"
#include "qqmljsresourcefilemapper_p.h"
#include <QtCore/qdir.h>
#include <QtCore/qqueue.h>
#include <QtCore/qscopedvaluerollback.h>
#include <QtCore/qpoint.h>
#include <QtCore/qrect.h>
#include <QtCore/qsize.h>
#include <QtQml/private/qqmlsignalnames_p.h>
#include <QtQml/private/qv4codegen_p.h>
#include <QtQml/private/qqmlstringconverters_p.h>
#include <QtQml/private/qqmlirbuilder_p.h>
#include "qqmljsscope_p.h"
#include "qqmljsutils_p.h"
#include "qqmljsloggingutils.h"
#include "qqmlsaconstants.h"
#include <algorithm>
#include <limits>
#include <optional>
#include <variant>
Include dependency graph for qqmljsimportvisitor.cpp:

Go to the source code of this file.

Functions

 Q_STATIC_LOGGING_CATEGORY (lcImportVisitor, "qt.qml.importVisitor", QtWarningMsg)
static bool causesImplicitComponentWrapping (const QQmlJSMetaProperty &property, const QQmlJSScope::ConstPtr &assignedType)
QString getScopeName (const QQmlJSScope::ConstPtr &scope, QQmlJSScope::ScopeType type)
template<typename Node>
QString buildName (const Node *node)
static void prepareTargetForVisit (const QQmlJSScope::Ptr &target)
static bool mayBeUnresolvedGroupedProperty (const QQmlJSScope::ConstPtr &scope)
static QQmlJSAnnotation::Value bindingToVariant (QQmlJS::AST::Statement *statement)
static QQmlJSMetaProperty resolveProperty (const QString &possiblyGroupedProperty, QQmlJSScope::ConstPtr scope)
static QList< QQmlJSScope::ConstPtrqmlScopeDescendants (const QQmlJSScope::ConstPtr &scope)
QQmlJSImportVisitor::UnfinishedBinding createNonUniqueScopeBinding (QQmlJSScope::Ptr &scope, const QString &name, const QQmlJS::SourceLocation &srcLocation)
static void logLowerCaseImport (QStringView superType, QQmlJS::SourceLocation location, QQmlJSLogger *logger)
void handleTranslationBinding (QQmlJSMetaPropertyBinding &binding, QStringView base, QQmlJS::AST::ArgumentList *args)
template<typename F>
void handlePragmaValues (QQmlJS::AST::UiPragma *pragma, F &&assign)

Variables

static const QLatin1StringView wasNotFound = "was not found."_L1
static const QLatin1StringView didYouAddAllImports = "Did you add all imports and dependencies?"_L1

Function Documentation

◆ bindingToVariant()

QQmlJSAnnotation::Value bindingToVariant ( QQmlJS::AST::Statement * statement)
static

Definition at line 628 of file qqmljsimportvisitor.cpp.

◆ buildName()

template<typename Node>
QString buildName ( const Node * node)

Definition at line 168 of file qqmljsimportvisitor.cpp.

◆ causesImplicitComponentWrapping()

bool causesImplicitComponentWrapping ( const QQmlJSMetaProperty & property,
const QQmlJSScope::ConstPtr & assignedType )
static

Returns if assigning assignedType to property would require an implicit component wrapping.

Definition at line 49 of file qqmljsimportvisitor.cpp.

◆ createNonUniqueScopeBinding()

QQmlJSImportVisitor::UnfinishedBinding createNonUniqueScopeBinding ( QQmlJSScope::Ptr & scope,
const QString & name,
const QQmlJS::SourceLocation & srcLocation )
inline

Creates a new binding of either a GroupProperty or an AttachedProperty type. The binding is added to the parentScope() of scope, under property name name and location srcLocation.

Definition at line 2432 of file qqmljsimportvisitor.cpp.

References QQmlSA::AttachedProperty, QQmlSA::AttachedPropertyScope, QQmlSA::GroupedPropertyScope, and QQmlSA::GroupProperty.

◆ getScopeName()

QString getScopeName ( const QQmlJSScope::ConstPtr & scope,
QQmlJSScope::ScopeType type )
inline

Returns the name of scope based on type.

Definition at line 151 of file qqmljsimportvisitor.cpp.

◆ handlePragmaValues()

template<typename F>
void handlePragmaValues ( QQmlJS::AST::UiPragma * pragma,
F && assign )

Definition at line 2831 of file qqmljsimportvisitor.cpp.

◆ handleTranslationBinding()

void handleTranslationBinding ( QQmlJSMetaPropertyBinding & binding,
QStringView base,
QQmlJS::AST::ArgumentList * args )

Definition at line 2202 of file qqmljsimportvisitor.cpp.

◆ logLowerCaseImport()

void logLowerCaseImport ( QStringView superType,
QQmlJS::SourceLocation location,
QQmlJSLogger * logger )
static

Definition at line 1780 of file qqmljsimportvisitor.cpp.

◆ mayBeUnresolvedGroupedProperty()

bool mayBeUnresolvedGroupedProperty ( const QQmlJSScope::ConstPtr & scope)
static

Definition at line 322 of file qqmljsimportvisitor.cpp.

References QQmlSA::GroupedPropertyScope.

◆ prepareTargetForVisit()

void prepareTargetForVisit ( const QQmlJSScope::Ptr & target)
static

Definition at line 196 of file qqmljsimportvisitor.cpp.

◆ Q_STATIC_LOGGING_CATEGORY()

Q_STATIC_LOGGING_CATEGORY ( lcImportVisitor ,
"qt.qml.importVisitor" ,
QtWarningMsg  )

◆ qmlScopeDescendants()

QList< QQmlJSScope::ConstPtr > qmlScopeDescendants ( const QQmlJSScope::ConstPtr & scope)
static

Definition at line 1083 of file qqmljsimportvisitor.cpp.

References QQmlSA::QMLScope.

◆ resolveProperty()

QQmlJSMetaProperty resolveProperty ( const QString & possiblyGroupedProperty,
QQmlJSScope::ConstPtr scope )
static

Resolves possiblyGroupedProperty on a type represented by scope. possiblyGroupedProperty can be either a simple name, or a grouped property ("foo.bar.baz") In the latter case, we resolve the "head" to a property, and then continue with the tail on the properties' type. We don't handle ids here

Definition at line 915 of file qqmljsimportvisitor.cpp.

Variable Documentation

◆ didYouAddAllImports

const QLatin1StringView didYouAddAllImports = "Did you add all imports and dependencies?"_L1
static

Definition at line 39 of file qqmljsimportvisitor.cpp.

◆ wasNotFound

const QLatin1StringView wasNotFound = "was not found."_L1
static

Definition at line 37 of file qqmljsimportvisitor.cpp.