Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QQmlSA::Binding Class Reference

\inmodule QtQmlCompiler More...

#include <qqmlsa.h>

+ Collaboration diagram for QQmlSA::Binding:

Classes

class  Bindings
 \inmodule QtQmlCompiler More...
 

Public Member Functions

 Binding ()
 
 Binding (const Binding &)
 
 Binding (Binding &&) noexcept
 
Bindingoperator= (const Binding &)
 
Bindingoperator= (Binding &&) noexcept
 
 ~Binding ()
 
Element groupType () const
 Returns the type of the property if this element is a group property, otherwise returns an invalid Element.
 
BindingType bindingType () const
 
QString stringValue () const
 Returns the associated string literal if the content type of this binding is StringLiteral, otherwise returns an empty string.
 
QString propertyName () const
 Returns the name of the property using this binding.
 
Element attachingType () const
 Returns the attached type if the content type of this binding is AttachedProperty, otherwise returns an invalid Element.
 
QQmlSA::SourceLocation sourceLocation () const
 Returns the location in the QML code where this binding is defined.
 
double numberValue () const
 Returns the associated number if the content type of this binding is NumberLiteral, otherwise returns 0.
 
ScriptBindingKind scriptKind () const
 Returns the kind of associated associated script if the content type of this binding is Script, otherwise returns Script_Invalid.
 
bool hasObject () const
 Returns true if this binding has an objects, otherwise returns false.
 
Element objectType () const
 Returns the type of the associated object if the content type of this binding is Object, otherwise returns an invlaid Element.
 
Element literalType (const QQmlJSTypeResolver *) const
 
bool hasUndefinedScriptValue () const
 

Static Public Member Functions

static bool isLiteralBinding (BindingType)
 Returns true if bindingType is a literal type, and false otherwise.
 

Friends

bool operator== (const Binding &lhs, const Binding &rhs)
 
bool operator!= (const Binding &lhs, const Binding &rhs)
 

Detailed Description

\inmodule QtQmlCompiler

Represents a single QML property binding for a specific type.

Definition at line 57 of file qqmlsa.h.

Constructor & Destructor Documentation

◆ Binding() [1/3]

QQmlSA::Binding::Binding ( )

Definition at line 100 of file qqmlsa.cpp.

◆ Binding() [2/3]

QQmlSA::Binding::Binding ( const Binding other)

Definition at line 104 of file qqmlsa.cpp.

◆ Binding() [3/3]

QQmlSA::Binding::Binding ( Binding &&  other)
noexcept

Definition at line 106 of file qqmlsa.cpp.

References other().

+ Here is the call graph for this function:

◆ ~Binding()

QQmlSA::Binding::~Binding ( )
default

Member Function Documentation

◆ attachingType()

Element QQmlSA::Binding::attachingType ( ) const

Returns the attached type if the content type of this binding is AttachedProperty, otherwise returns an invalid Element.

Definition at line 193 of file qqmlsa.cpp.

References QQmlJSMetaPropertyBinding::attachingType(), QQmlSA::BindingPrivate::binding(), and QQmlJSScope::createQQmlSAElement().

+ Here is the call graph for this function:

◆ bindingType()

QQmlSA::BindingType QQmlSA::Binding::bindingType ( ) const

Definition at line 167 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::binding(), and QQmlJSMetaPropertyBinding::bindingType().

Referenced by VarBindingTypeValidatorPass::onBinding().

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

◆ groupType()

Element QQmlSA::Binding::groupType ( ) const

Returns the type of the property if this element is a group property, otherwise returns an invalid Element.

Definition at line 162 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::binding(), QQmlJSScope::createQQmlSAElement(), and QQmlJSMetaPropertyBinding::groupType().

+ Here is the call graph for this function:

◆ hasObject()

bool QQmlSA::Binding::hasObject ( ) const

Returns true if this binding has an objects, otherwise returns false.

Definition at line 228 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::binding(), and QQmlJSMetaPropertyBinding::hasObject().

+ Here is the call graph for this function:

◆ hasUndefinedScriptValue()

bool QQmlSA::Binding::hasUndefinedScriptValue ( ) const

Definition at line 247 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::binding(), QQmlSA::Script, and ScriptValue_Undefined.

+ Here is the call graph for this function:

◆ isLiteralBinding()

bool QQmlSA::Binding::isLiteralBinding ( QQmlSA::BindingType  bindingType)
static

Returns true if bindingType is a literal type, and false otherwise.

Literal types include strings, booleans, numbers, regular expressions among other.

Definition at line 259 of file qqmlsa.cpp.

Referenced by VarBindingTypeValidatorPass::onBinding().

+ Here is the caller graph for this function:

◆ literalType()

Element QQmlSA::Binding::literalType ( const QQmlJSTypeResolver resolver) const

Definition at line 242 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::binding(), QQmlJSScope::createQQmlSAElement(), and QQmlJSMetaPropertyBinding::literalType().

Referenced by QQmlSA::GenericPass::resolveLiteralType().

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

◆ numberValue()

double QQmlSA::Binding::numberValue ( ) const

Returns the associated number if the content type of this binding is NumberLiteral, otherwise returns 0.

Definition at line 211 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::binding(), and QQmlJSMetaPropertyBinding::numberValue().

+ Here is the call graph for this function:

◆ objectType()

QQmlSA::Element QQmlSA::Binding::objectType ( ) const

Returns the type of the associated object if the content type of this binding is Object, otherwise returns an invlaid Element.

Definition at line 237 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::binding(), QQmlJSScope::createQQmlSAElement(), and QQmlJSMetaPropertyBinding::objectType().

Referenced by VarBindingTypeValidatorPass::onBinding().

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

◆ operator=() [1/2]

Binding & QQmlSA::Binding::operator= ( Binding &&  other)
noexcept

Definition at line 119 of file qqmlsa.cpp.

References other().

+ Here is the call graph for this function:

◆ operator=() [2/2]

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

Definition at line 109 of file qqmlsa.cpp.

References other().

+ Here is the call graph for this function:

◆ propertyName()

QString QQmlSA::Binding::propertyName ( ) const

Returns the name of the property using this binding.

Definition at line 184 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::binding(), and QQmlJSMetaPropertyBinding::propertyName().

+ Here is the call graph for this function:

◆ scriptKind()

QQmlSA::ScriptBindingKind QQmlSA::Binding::scriptKind ( ) const

Returns the kind of associated associated script if the content type of this binding is Script, otherwise returns Script_Invalid.

Definition at line 220 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::binding(), and QQmlJSMetaPropertyBinding::scriptKind().

+ Here is the call graph for this function:

◆ sourceLocation()

QQmlSA::SourceLocation QQmlSA::Binding::sourceLocation ( ) const

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

Definition at line 201 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::binding(), QQmlSA::SourceLocationPrivate::createQQmlSASourceLocation(), and QQmlJSMetaPropertyBinding::sourceLocation().

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

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

◆ stringValue()

QString QQmlSA::Binding::stringValue ( ) const

Returns the associated string literal if the content type of this binding is StringLiteral, otherwise returns an empty string.

Definition at line 176 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::binding(), and QQmlJSMetaPropertyBinding::stringValue().

+ Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

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

Definition at line 104 of file qqmlsa.h.

◆ operator==

bool operator== ( const Binding lhs,
const Binding rhs 
)
friend

Definition at line 100 of file qqmlsa.h.


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