Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QQmlSA::Element Class Reference

\inmodule QtQmlCompiler More...

#include <qqmlsa.h>

+ Collaboration diagram for QQmlSA::Element:

Public Member Functions

 Element ()
 
 Element (const Element &)
 
 Element (Element &&other) noexcept
 
Elementoperator= (const Element &)
 
 ~Element ()
 
ScopeType scopeType () const
 Returns the type of Element's scope.
 
Element baseType () const
 Returns the Element this Element derives from.
 
QString baseTypeName () const
 Returns the name of the Element this Element derives from.
 
Element parentScope () const
 Returns the Element that encloses this Element.
 
bool inherits (const Element &) const
 Returns whether this Element inherits from element.
 
bool isNull () const
 
QString internalId () const
 
AccessSemantics accessSemantics () const
 Returns the access semantics of this Element.
 
bool isComposite () const
 Returns true for objects defined from Qml, and false for objects declared from C++.
 
bool hasProperty (const QString &propertyName) const
 Returns whether this Element has a property with the name propertyName.
 
Property property (const QString &propertyName) const
 Returns the property with the name propertyName if it is found in this Element or its base and extension objects, otherwise returns an invalid property.
 
bool isPropertyRequired (const QString &propertyName) const
 Returns whether the property with the name propertyName resolved on this Element is required.
 
QString defaultPropertyName () const
 Returns the name of the default property of this Element.
 
bool hasMethod (const QString &methodName) const
 Returns whether this Element has a method with the name methodName.
 
Method::Methods ownMethods () const
 Returns this Elements's method which are not defined on its base or extension objects.
 
QQmlSA::SourceLocation sourceLocation () const
 Returns the location in the QML code where this method is defined.
 
QString filePath () const
 Returns the file path of the QML code that defines this method.
 
bool hasPropertyBindings (const QString &name) const
 Returns whethe this Element has a property binding with the name name.
 
bool hasOwnPropertyBindings (const QString &propertyName) const
 Returns whether this Element has property bindings which are not defined in its base or extension objects and that have name propertyName.
 
Binding::Bindings ownPropertyBindings () const
 Returns this Element's property bindings which are not defined on its base or extension objects.
 
Binding::Bindings ownPropertyBindings (const QString &propertyName) const
 Returns this Element's property bindings which are not defined on its base or extension objects and that have the name propertyName.
 
QList< BindingpropertyBindings (const QString &propertyName) const
 Returns this Element's property bindings that have the name propertyName.
 
QQmlJS::ConstPtrWrapperIterator childScopesBegin () const
 Returns an iterator to the beginning of this Element's children.
 
QQmlJS::ConstPtrWrapperIterator childScopesEnd () const
 Returns an iterator to the end of this Element's children.
 
 operator bool () const
 
bool operator! () const
 
QString name () const
 Returns the name of this Element.
 

Friends

class QT_PREPEND_NAMESPACE (QQmlJSScope)
 
bool operator== (const QQmlSA::Element &lhs, const QQmlSA::Element &rhs)
 
bool operator!= (const Element &lhs, const Element &rhs)
 
qsizetype qHash (const Element &key, qsizetype seed=0) noexcept
 
void swap (Element &lhs, Element &rhs) noexcept
 

Detailed Description

\inmodule QtQmlCompiler

Represents a QML type.

Definition at line 196 of file qqmlsa.h.

Constructor & Destructor Documentation

◆ Element() [1/3]

QQmlSA::Element::Element ( )

Definition at line 518 of file qqmlsa.cpp.

◆ Element() [2/3]

QQmlSA::Element::Element ( const Element other)

Definition at line 523 of file qqmlsa.cpp.

References other(), and QQmlJSScope::scope().

+ Here is the call graph for this function:

◆ Element() [3/3]

QQmlSA::Element::Element ( Element &&  other)
inlinenoexcept

Definition at line 203 of file qqmlsa.h.

References m_data, and other().

+ Here is the call graph for this function:

◆ ~Element()

QQmlSA::Element::~Element ( )

Definition at line 537 of file qqmlsa.cpp.

Member Function Documentation

◆ accessSemantics()

AccessSemantics QQmlSA::Element::accessSemantics ( ) const

Returns the access semantics of this Element.

For example, Reference, Value or Sequence.

Definition at line 599 of file qqmlsa.cpp.

References QQmlJSScope::accessSemantics(), and QQmlJSScope::scope().

+ Here is the call graph for this function:

◆ baseType()

Element QQmlSA::Element::baseType ( ) const

Returns the Element this Element derives from.

Definition at line 553 of file qqmlsa.cpp.

References QQmlJSScope::baseType(), QQmlJSScope::createQQmlSAElement(), and QQmlJSScope::scope().

Referenced by QQmlSA::lookupName(), AttachedPropertyTypeValidatorPass::onBinding(), and VarBindingTypeValidatorPass::onBinding().

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

◆ baseTypeName()

QString QQmlSA::Element::baseTypeName ( ) const

Returns the name of the Element this Element derives from.

Definition at line 561 of file qqmlsa.cpp.

References QQmlJSScope::baseTypeName(), QQmlJSScope::prettyName(), and QQmlJSScope::scope().

Referenced by QQmlSA::DebugPropertyPass::onBinding(), QQmlSA::DebugPropertyPass::onRead(), QQmlSA::DebugPropertyPass::onWrite(), and QQmlSA::DebugElementPass::run().

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

◆ childScopesBegin()

QQmlJS::ConstPtrWrapperIterator QQmlSA::Element::childScopesBegin ( ) const

Returns an iterator to the beginning of this Element's children.

Definition at line 768 of file qqmlsa.cpp.

References QQmlJSScope::childScopesBegin(), and QQmlJSScope::scope().

Referenced by QQmlSA::PassManagerPrivate::analyze().

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

◆ childScopesEnd()

QQmlJS::ConstPtrWrapperIterator QQmlSA::Element::childScopesEnd ( ) const

Returns an iterator to the end of this Element's children.

Definition at line 776 of file qqmlsa.cpp.

References QQmlJSScope::childScopesEnd(), and QQmlJSScope::scope().

Referenced by QQmlSA::PassManagerPrivate::analyze().

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

◆ defaultPropertyName()

QString QQmlSA::Element::defaultPropertyName ( ) const

Returns the name of the default property of this Element.

If it doesn't have one, returns an empty string.

Definition at line 642 of file qqmlsa.cpp.

References QQmlJSScope::defaultPropertyName(), and QQmlJSScope::scope().

Referenced by QQmlSA::DebugElementPass::run().

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

◆ filePath()

QString QQmlSA::Element::filePath ( ) const

Returns the file path of the QML code that defines this method.

Definition at line 683 of file qqmlsa.cpp.

References QQmlJSScope::filePath(), and QQmlJSScope::scope().

+ Here is the call graph for this function:

◆ hasMethod()

bool QQmlSA::Element::hasMethod ( const QString methodName) const

Returns whether this Element has a method with the name methodName.

Definition at line 650 of file qqmlsa.cpp.

References QQmlJSScope::hasMethod(), methodName(), and QQmlJSScope::scope().

Referenced by AttachedPropertyTypeValidatorPass::onRead(), and AttachedPropertyReuse::onRead().

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

◆ hasOwnPropertyBindings()

bool QQmlSA::Element::hasOwnPropertyBindings ( const QString propertyName) const

Returns whether this Element has property bindings which are not defined in its base or extension objects and that have name propertyName.

Definition at line 700 of file qqmlsa.cpp.

References QQmlJSScope::hasOwnPropertyBindings(), and QQmlJSScope::scope().

Referenced by ForbiddenChildrenPropertyValidatorPass::run(), ControlsNativeValidatorPass::run(), and AnchorsValidatorPass::shouldRun().

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

◆ hasProperty()

bool QQmlSA::Element::hasProperty ( const QString propertyName) const

Returns whether this Element has a property with the name propertyName.

Definition at line 615 of file qqmlsa.cpp.

References QQmlJSScope::hasProperty(), and QQmlJSScope::scope().

Referenced by AttachedPropertyTypeValidatorPass::onRead(), AttachedPropertyReuse::onRead(), and PropertyChangesValidatorPass::run().

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

◆ hasPropertyBindings()

bool QQmlSA::Element::hasPropertyBindings ( const QString name) const

Returns whethe this Element has a property binding with the name name.

Definition at line 691 of file qqmlsa.cpp.

References QQmlJSScope::hasPropertyBindings(), and QQmlJSScope::scope().

+ Here is the call graph for this function:

◆ inherits()

bool QQmlSA::Element::inherits ( const Element element) const

Returns whether this Element inherits from element.

Definition at line 577 of file qqmlsa.cpp.

References QQmlJSScope::inherits(), and QQmlJSScope::scope().

Referenced by ControlsNativeValidatorPass::ControlsNativeValidatorPass(), ForbiddenChildrenPropertyValidatorPass::run(), ControlsNativeValidatorPass::run(), ForbiddenChildrenPropertyValidatorPass::shouldRun(), ControlsNativeValidatorPass::shouldRun(), AnchorsValidatorPass::shouldRun(), ControlsSwipeDelegateValidatorPass::shouldRun(), and PropertyChangesValidatorPass::shouldRun().

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

◆ internalId()

QString QQmlSA::Element::internalId ( ) const

Definition at line 590 of file qqmlsa.cpp.

References QQmlJSScope::internalName(), and QQmlJSScope::scope().

Referenced by AttachedPropertyTypeValidatorPass::addWarning().

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

◆ isComposite()

bool QQmlSA::Element::isComposite ( ) const

Returns true for objects defined from Qml, and false for objects declared from C++.

Definition at line 607 of file qqmlsa.cpp.

References QQmlJSScope::isComposite(), and QQmlJSScope::scope().

Referenced by VarBindingTypeValidatorPass::onBinding().

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

◆ isNull()

bool QQmlSA::Element::isNull ( ) const

Definition at line 582 of file qqmlsa.cpp.

References QDeferredSharedPointer< T >::isNull(), and QQmlJSScope::scope().

Referenced by VarBindingTypeValidatorPass::VarBindingTypeValidatorPass(), QQmlSA::lookupName(), name(), PropertyChangesValidatorPass::run(), AnchorsValidatorPass::shouldRun(), ControlsSwipeDelegateValidatorPass::shouldRun(), and PropertyChangesValidatorPass::shouldRun().

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

◆ isPropertyRequired()

bool QQmlSA::Element::isPropertyRequired ( const QString propertyName) const

Returns whether the property with the name propertyName resolved on this Element is required.

Returns false if the the property couldn't be found.

Definition at line 633 of file qqmlsa.cpp.

References QQmlJSScope::isPropertyRequired(), and QQmlJSScope::scope().

+ Here is the call graph for this function:

◆ name()

QString QQmlSA::Element::name ( ) const

Returns the name of this Element.

Definition at line 794 of file qqmlsa.cpp.

References QQmlJSScope::internalName(), isNull(), QQmlJSScope::prettyName(), and QQmlJSScope::scope().

Referenced by ControlsNativeValidatorPass::ControlsNativeValidatorPass(), VarBindingTypeValidatorPass::onBinding(), and AttachedPropertyReuse::onRead().

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

◆ operator bool()

QQmlSA::Element::operator bool ( ) const
explicit

Definition at line 781 of file qqmlsa.cpp.

References QQmlJSScope::scope().

+ Here is the call graph for this function:

◆ operator!()

bool QQmlSA::Element::operator! ( ) const

Definition at line 786 of file qqmlsa.cpp.

References QQmlJSScope::scope().

+ Here is the call graph for this function:

◆ operator=()

Element & QQmlSA::Element::operator= ( const Element other)

Definition at line 528 of file qqmlsa.cpp.

References other(), and QQmlJSScope::scope().

+ Here is the call graph for this function:

◆ ownMethods()

Method::Methods QQmlSA::Element::ownMethods ( ) const

Returns this Elements's method which are not defined on its base or extension objects.

Definition at line 666 of file qqmlsa.cpp.

References QQmlSA::MethodsPrivate::createMethods(), QQmlJSScope::ownMethods(), and QQmlJSScope::scope().

+ Here is the call graph for this function:

◆ ownPropertyBindings() [1/2]

Binding::Bindings QQmlSA::Element::ownPropertyBindings ( ) const

Returns this Element's property bindings which are not defined on its base or extension objects.

Definition at line 709 of file qqmlsa.cpp.

References QQmlSA::BindingsPrivate::createBindings(), QQmlJSScope::ownPropertyBindings(), and QQmlJSScope::scope().

Referenced by ForbiddenChildrenPropertyValidatorPass::run(), AnchorsValidatorPass::run(), ControlsSwipeDelegateValidatorPass::run(), and PropertyChangesValidatorPass::run().

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

◆ ownPropertyBindings() [2/2]

Binding::Bindings QQmlSA::Element::ownPropertyBindings ( const QString propertyName) const

Returns this Element's property bindings which are not defined on its base or extension objects and that have the name propertyName.

Definition at line 718 of file qqmlsa.cpp.

References QQmlSA::BindingsPrivate::createBindings(), QQmlJSScope::ownPropertyBindings(), and QQmlJSScope::scope().

+ Here is the call graph for this function:

◆ parentScope()

Element QQmlSA::Element::parentScope ( ) const

Returns the Element that encloses this Element.

Definition at line 569 of file qqmlsa.cpp.

References QQmlJSScope::createQQmlSAElement(), QQmlJSScope::parentScope(), and QQmlJSScope::scope().

Referenced by AttachedPropertyReuse::onRead(), ForbiddenChildrenPropertyValidatorPass::run(), and ForbiddenChildrenPropertyValidatorPass::shouldRun().

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

◆ property()

QQmlSA::Property QQmlSA::Element::property ( const QString propertyName) const

Returns the property with the name propertyName if it is found in this Element or its base and extension objects, otherwise returns an invalid property.

Definition at line 624 of file qqmlsa.cpp.

References QQmlSA::PropertyPrivate::createProperty(), QQmlJSScope::property(), and QQmlJSScope::scope().

+ Here is the call graph for this function:

◆ propertyBindings()

QList< Binding > QQmlSA::Element::propertyBindings ( const QString propertyName) const

Returns this Element's property bindings that have the name propertyName.

Definition at line 727 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::createBinding(), QQmlJSScope::propertyBindings(), QList< T >::push_back(), and QQmlJSScope::scope().

Referenced by QQmlSA::DebugElementPass::run(), AnchorsValidatorPass::run(), and ControlsSwipeDelegateValidatorPass::run().

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

◆ scopeType()

QQmlJSScope::ScopeType QQmlSA::Element::scopeType ( ) const

Returns the type of Element's scope.

Definition at line 545 of file qqmlsa.cpp.

References QQmlJSScope::scope(), and QQmlJSScope::scopeType().

+ Here is the call graph for this function:

◆ sourceLocation()

QQmlSA::SourceLocation QQmlSA::Element::sourceLocation ( ) const

Returns the location in the QML code where this method is defined.

Definition at line 674 of file qqmlsa.cpp.

References QQmlSA::SourceLocationPrivate::createQQmlSASourceLocation(), QQmlJSScope::scope(), and QQmlJSScope::sourceLocation().

Referenced by ControlsNativeValidatorPass::run().

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

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const Element lhs,
const Element rhs 
)
friend

Definition at line 253 of file qqmlsa.h.

◆ operator==

bool operator== ( const QQmlSA::Element lhs,
const QQmlSA::Element rhs 
)
friend

Definition at line 249 of file qqmlsa.h.

◆ qHash

qsizetype qHash ( const Element key,
qsizetype  seed = 0 
)
friend

Definition at line 255 of file qqmlsa.h.

◆ QT_PREPEND_NAMESPACE

class QT_PREPEND_NAMESPACE ( QQmlJSScope  )
friend

◆ swap

void swap ( Element lhs,
Element rhs 
)
friend

Definition at line 274 of file qqmlsa.h.


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