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::Element Class Reference

\inmodule QtQmlCompiler More...

#include <qqmlsa.h>

Collaboration diagram for QQmlSA::Element:

Public Member Functions

 Element ()
 Constructs a new Element object.
 Element (const Element &)
 Creates a copy of other.
 Element (Element &&other) noexcept
 Move-constructs an Element instance.
Elementoperator= (const Element &)
 Assigns other to this element instance.
 ~Element ()
 Destroys the 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 isFileRootComponent () const
 Returns whether this Element is the root component of its QML file.
bool isNull () const
 Returns true if this element is null, false otherwise.
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.
QQmlSA::SourceLocation idSourceLocation () const
 Returns the location in the QML code where this Element is assigned its id, if it has one.
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
 Returns true if this element is not null, false otherwise.
bool operator! () const
 Returns true if this element is null, false otherwise.
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)
 Returns true if lhs and rhs are equal, and false otherwise.
bool operator!= (const Element &lhs, const Element &rhs)
 Returns true if lhs and rhs are not equal, and false otherwise.
qsizetype qHash (const Element &key, qsizetype seed=0) noexcept
 Returns the hash for key using seed to seed the calculation.
void swap (Element &lhs, Element &rhs) noexcept

Detailed Description

\inmodule QtQmlCompiler

Represents a QML type.

Definition at line 201 of file qqmlsa.h.

Constructor & Destructor Documentation

◆ Element() [1/3]

QQmlSA::Element::Element ( )

Constructs a new Element object.

Definition at line 877 of file qqmlsa.cpp.

◆ Element() [2/3]

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

Creates a copy of other.

Definition at line 885 of file qqmlsa.cpp.

◆ Element() [3/3]

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

Move-constructs an Element instance.

Definition at line 208 of file qqmlsa.h.

◆ ~Element()

QQmlSA::Element::~Element ( )

Destroys the element.

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

◆ baseType()

Element QQmlSA::Element::baseType ( ) const

Returns the Element this Element derives from.

Definition at line 931 of file qqmlsa.cpp.

◆ baseTypeName()

QString QQmlSA::Element::baseTypeName ( ) const

Returns the name of the Element this Element derives from.

Definition at line 939 of file qqmlsa.cpp.

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

◆ filePath()

QString QQmlSA::Element::filePath ( ) const

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

Definition at line 1090 of file qqmlsa.cpp.

◆ hasMethod()

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

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

Definition at line 1048 of file qqmlsa.cpp.

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

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

◆ hasProperty()

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

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

Definition at line 1004 of file qqmlsa.cpp.

◆ hasPropertyBindings()

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

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

Definition at line 1098 of file qqmlsa.cpp.

◆ idSourceLocation()

QQmlSA::SourceLocation QQmlSA::Element::idSourceLocation ( ) const

Returns the location in the QML code where this Element is assigned its id, if it has one.

Definition at line 1081 of file qqmlsa.cpp.

◆ inherits()

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

Returns whether this Element inherits from element.

Definition at line 955 of file qqmlsa.cpp.

◆ internalId()

QString QQmlSA::Element::internalId ( ) const

Definition at line 979 of file qqmlsa.cpp.

◆ isComposite()

bool QQmlSA::Element::isComposite ( ) const

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

Definition at line 996 of file qqmlsa.cpp.

◆ isFileRootComponent()

bool QQmlSA::Element::isFileRootComponent ( ) const

Returns whether this Element is the root component of its QML file.

Definition at line 963 of file qqmlsa.cpp.

◆ isNull()

bool QQmlSA::Element::isNull ( ) const

Returns true if this element is null, false otherwise.

Definition at line 971 of file qqmlsa.cpp.

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

◆ name()

QString QQmlSA::Element::name ( ) const

Returns the name of this Element.

Definition at line 1191 of file qqmlsa.cpp.

◆ operator bool()

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

Returns true if this element is not null, false otherwise.

Definition at line 1175 of file qqmlsa.cpp.

◆ operator!()

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

Returns true if this element is null, false otherwise.

Definition at line 1183 of file qqmlsa.cpp.

◆ operator=()

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

Assigns other to this element instance.

Move-assigns other to this Element instance.

Definition at line 898 of file qqmlsa.cpp.

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

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

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

◆ parentScope()

Element QQmlSA::Element::parentScope ( ) const

Returns the Element that encloses this Element.

Definition at line 947 of file qqmlsa.cpp.

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

◆ propertyBindings()

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

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

Definition at line 1134 of file qqmlsa.cpp.

◆ scopeType()

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

Returns the type of Element's scope.

Definition at line 923 of file qqmlsa.cpp.

◆ sourceLocation()

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

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

Definition at line 1072 of file qqmlsa.cpp.

◆ operator!=

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

Returns true if lhs and rhs are not equal, and false otherwise.

Definition at line 258 of file qqmlsa.h.

◆ operator==

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

Returns true if lhs and rhs are equal, and false otherwise.

Definition at line 254 of file qqmlsa.h.

◆ qHash

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

Returns the hash for key using seed to seed the calculation.

Definition at line 260 of file qqmlsa.h.

◆ QT_PREPEND_NAMESPACE

class QT_PREPEND_NAMESPACE ( QQmlJSScope )
friend

◆ swap

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

Definition at line 279 of file qqmlsa.h.


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