Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qqmljsimportvisitor.cpp File Reference

(c2a65fbe04bbcac066a8bf1527d064d4866efbfe)

#include "qqmljsimportvisitor_p.h"
#include "qqmljslogger_p.h"
#include "qqmljsmetatypes_p.h"
#include "qqmljsresourcefilemapper_p.h"
#include <QtCore/qfileinfo.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

static bool causesImplicitComponentWrapping (const QQmlJSMetaProperty &property, const QQmlJSScope::ConstPtr &assignedType)
 
void setScopeName (QQmlJSScope::Ptr &scope, QQmlJSScope::ScopeType type, const QString &name)
 
QString getScopeName (const QQmlJSScope::ConstPtr &scope, QQmlJSScope::ScopeType type)
 
template<typename Node >
QString buildName (const Node *node)
 
static bool mayBeUnresolvedGeneralizedGroupedProperty (const QQmlJSScope::ConstPtr &scope)
 
static QQmlJSAnnotation::Value bindingToVariant (QQmlJS::AST::Statement *statement)
 
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)
 

Function Documentation

◆ bindingToVariant()

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

Definition at line 493 of file qqmljsimportvisitor.cpp.

References QQmlJS::AST::ExpressionStatement::expression, and QQmlJS::AST::Node::kind.

Referenced by QQmlJSImportVisitor::parseAnnotations().

+ Here is the caller graph for this function:

◆ buildName()

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

Definition at line 108 of file qqmljsimportvisitor.cpp.

Referenced by QQmlJSImportVisitor::parseAnnotations(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ causesImplicitComponentWrapping()

static 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 42 of file qqmljsimportvisitor.cpp.

References QQmlJSScope::nonCompositeBaseType(), and Q_ASSERT.

Referenced by QQmlJSImportVisitor::processDefaultProperties(), and QQmlJSImportVisitor::processPropertyBindingObjects().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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 2042 of file qqmljsimportvisitor.cpp.

References QQmlSA::AttachedProperty, QQmlSA::AttachedPropertyScope, createBinding(), QQmlSA::GroupedPropertyScope, QQmlSA::GroupProperty, QQmlJSScope::ownPropertyBindings(), QQmlJSScope::parentScope(), Q_ASSERT, QQmlJSScope::scopeType(), QQmlJSMetaPropertyBinding::setAttachedBinding(), and QQmlJSMetaPropertyBinding::setGroupBinding().

Referenced by QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getScopeName()

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

Returns the name of scope based on type.

Definition at line 97 of file qqmljsimportvisitor.cpp.

References QQmlSA::AttachedPropertyScope, QQmlJSScope::baseTypeName(), QQmlSA::GroupedPropertyScope, QQmlJSScope::internalName(), and Q_ASSERT.

Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlJSImportVisitor::checkRequiredProperties(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::endVisit(), QQmlJSImportVisitor::isTypeResolved(), QQmlJSImportVisitor::processPropertyBindingObjects(), and QQmlJSImportVisitor::setAllBindings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handlePragmaValues()

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

Definition at line 2411 of file qqmljsimportvisitor.cpp.

Referenced by QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ handleTranslationBinding()

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

Definition at line 1851 of file qqmljsimportvisitor.cpp.

References args, base, QQmlJSMetaPropertyBinding::setStringLiteral(), QQmlJSMetaPropertyBinding::setTranslation(), QQmlJSMetaPropertyBinding::setTranslationId(), QmlIR::tryGeneratingTranslationBindingBase(), QV4::CompiledData::Binding::Type_Translation, and QV4::CompiledData::Binding::Type_TranslationById.

Referenced by QQmlJSImportVisitor::parseBindingExpression().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ logLowerCaseImport()

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

Definition at line 1465 of file qqmljsimportvisitor.cpp.

References QStringView::first(), QQmlJSLogger::log(), and qmlUncreatableType.

Referenced by QQmlJSImportVisitor::visit(), QQmlJSImportVisitor::visit(), and QQmlJSImportVisitor::visit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mayBeUnresolvedGeneralizedGroupedProperty()

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

Definition at line 236 of file qqmljsimportvisitor.cpp.

References QQmlJSScope::baseType(), QQmlSA::GroupedPropertyScope, and QQmlJSScope::scopeType().

+ Here is the call graph for this function:

◆ setScopeName()

void setScopeName ( QQmlJSScope::Ptr & scope,
QQmlJSScope::ScopeType type,
const QString & name )
inline

Sets the name of scope to name based on type.

Definition at line 83 of file qqmljsimportvisitor.cpp.

References QQmlSA::AttachedPropertyScope, QQmlSA::GroupedPropertyScope, Q_ASSERT, QQmlJSScope::setBaseTypeName(), and QQmlJSScope::setInternalName().

+ Here is the call graph for this function: