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
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.
 
bool hasOwnProperty (const QString &propertyName) const
 Returns whether this Element defines a property with the name propertyName which is not defined on its base or extension objects.
 
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 methods, which are not defined on its base or extension objects.
 
QQmlSA::SourceLocation sourceLocation () const
 Returns the location in the QML code where this Element is defined.
 
QString filePath () const
 Returns the file path of the QML code that defines this Element.
 
bool hasPropertyBindings (const QString &name) const
 Returns whether 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.
 
 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 192 of file qqmlsa.h.

Constructor & Destructor Documentation

◆ Element() [1/3]

QQmlSA::Element::Element ( )

Definition at line 556 of file qqmlsa.cpp.

◆ Element() [2/3]

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

Definition at line 561 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 199 of file qqmlsa.h.

References m_data, and other().

+ Here is the call graph for this function:

◆ ~Element()

QQmlSA::Element::~Element ( )

Definition at line 575 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 637 of file qqmlsa.cpp.

References 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 591 of file qqmlsa.cpp.

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

Referenced by QQmlSA::PassManagerPrivate::analyzeBinding(), QQmlSA::lookupName(), AttachedPropertyTypeValidatorPass::onBinding(), VarBindingTypeValidatorPass::onBinding(), and AttachedPropertyReuse::onRead().

+ 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 599 of file qqmlsa.cpp.

References 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:

◆ 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 689 of file qqmlsa.cpp.

References 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 Element.

Definition at line 730 of file qqmlsa.cpp.

References 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 697 of file qqmlsa.cpp.

References 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:

◆ hasOwnProperty()

bool QQmlSA::Element::hasOwnProperty ( const QString & propertyName) const

Returns whether this Element defines a property with the name propertyName which is not defined on its base or extension objects.

Definition at line 662 of file qqmlsa.cpp.

References QQmlJSScope::scope().

Referenced by LiteralBindingCheckBase::onBinding().

+ 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 747 of file qqmlsa.cpp.

References 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 653 of file qqmlsa.cpp.

References 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 whether this Element has a property binding with the name name.

Definition at line 738 of file qqmlsa.cpp.

References 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 615 of file qqmlsa.cpp.

References 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 628 of file qqmlsa.cpp.

References 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 645 of file qqmlsa.cpp.

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

Referenced by isComposite(), and 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 620 of file qqmlsa.cpp.

References QQmlJSScope::scope().

Referenced by ControlsNativeValidatorPass::ControlsNativeValidatorPass(), VarBindingTypeValidatorPass::VarBindingTypeValidatorPass(), QQmlSA::PassManagerPrivate::addBindingSourceLocations(), QQmlSA::PassManagerPrivate::analyzeBinding(), QQmlSA::lookupName(), name(), 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 680 of file qqmlsa.cpp.

References 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 825 of file qqmlsa.cpp.

References 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 812 of file qqmlsa.cpp.

References QQmlJSScope::scope().

+ Here is the call graph for this function:

◆ operator!()

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

Definition at line 817 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 566 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 methods, which are not defined on its base or extension objects.

Definition at line 713 of file qqmlsa.cpp.

References QQmlSA::MethodsPrivate::createMethods(), 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 756 of file qqmlsa.cpp.

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

Referenced by QQmlSA::PassManagerPrivate::addBindingSourceLocations(), 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 765 of file qqmlsa.cpp.

References QQmlSA::BindingsPrivate::createBindings(), 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 607 of file qqmlsa.cpp.

References QQmlJSScope::createQQmlSAElement(), 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 671 of file qqmlsa.cpp.

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

Referenced by LiteralBindingCheckBase::getProperty().

+ Here is the call graph for this function:
+ Here is the caller 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 774 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::createBinding(), 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 583 of file qqmlsa.cpp.

References QQmlJSScope::scope().

+ Here is the call graph for this function:

◆ sourceLocation()

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

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

Definition at line 721 of file qqmlsa.cpp.

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

Referenced by QQmlSA::PassManagerPrivate::addBindingSourceLocations(), and 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 247 of file qqmlsa.h.

◆ operator==

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

Definition at line 243 of file qqmlsa.h.

◆ qHash

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

Definition at line 249 of file qqmlsa.h.

◆ QT_PREPEND_NAMESPACE

class QT_PREPEND_NAMESPACE ( QQmlJSScope )
friend

◆ swap

void swap ( Element & lhs,
Element & rhs )
friend

Definition at line 268 of file qqmlsa.h.


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