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::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 of this binding if it 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 bound with 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 the 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 invalid Element.
 
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 51 of file qqmlsa.h.

Constructor & Destructor Documentation

◆ Binding() [1/3]

QQmlSA::Binding::Binding ( )

Definition at line 98 of file qqmlsa.cpp.

◆ Binding() [2/3]

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

Definition at line 102 of file qqmlsa.cpp.

◆ Binding() [3/3]

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

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

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

+ Here is the call graph for this function:

◆ bindingType()

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

Definition at line 165 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::binding().

Referenced by LiteralBindingCheckBase::getProperty(), VarBindingTypeValidatorPass::onBinding(), and QQmlJSLiteralBindingCheck::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 of this binding if it is a group property, otherwise returns an invalid Element.

Definition at line 160 of file qqmlsa.cpp.

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

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

References QQmlSA::BindingPrivate::binding().

+ Here is the call graph for this function:

◆ hasUndefinedScriptValue()

bool QQmlSA::Binding::hasUndefinedScriptValue ( ) const

Definition at line 240 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.

Definition at line 252 of file qqmlsa.cpp.

Referenced by LiteralBindingCheckBase::getProperty(), and VarBindingTypeValidatorPass::onBinding().

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

References QQmlSA::BindingPrivate::binding().

+ 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 invalid Element.

Definition at line 235 of file qqmlsa.cpp.

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

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 117 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 107 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 bound with this binding.

Definition at line 182 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::binding().

+ Here is the call graph for this function:

◆ scriptKind()

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

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

Definition at line 218 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::binding().

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

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

Referenced by AttachedPropertyTypeValidatorPass::onBinding(), VarBindingTypeValidatorPass::onBinding(), LiteralBindingCheckBase::onBinding(), QQmlJSLiteralBindingCheck::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 174 of file qqmlsa.cpp.

References QQmlSA::BindingPrivate::binding().

Referenced by LiteralBindingCheckBase::onBinding().

+ 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 Binding & lhs,
const Binding & rhs )
friend

Definition at line 97 of file qqmlsa.h.

◆ operator==

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

Definition at line 93 of file qqmlsa.h.


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