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

\inmodule QtQmlCompiler More...

#include <qqmlsa.h>

Collaboration diagram for QQmlSA::Binding:

Classes

class  Bindings
 \inmodule QtQmlCompiler More...

Public Member Functions

 Binding ()
 Constructs a new Binding object.
 Binding (const Binding &)
 Creates a copy of other.
 Binding (Binding &&) noexcept
 Move-constructs a Binding instance.
Bindingoperator= (const Binding &)
 Assigns other to this Binding instance.
Bindingoperator= (Binding &&) noexcept
 Move-assigns other to this Binding instance.
 ~Binding ()
 Destroys the binding.
Element groupType () const
 Returns the type of the property of this binding if it is a group property, otherwise returns an invalid Element.
Element bindingScope () const
 Returns the Element scope in which the binding is defined.
BindingType bindingType () const
 Returns the type of this binding.
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.
bool isAttached () const
 Returns true if this type is attached to another one, false otherwise.
Element attachedType () 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 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
 Returns whether this binding has script value type undefined like when it is assigned undefined.
bool hasFunctionScriptValue () const
 Returns whether this binding has script value type function like when it is assigned a (lambda) method, an arrow function or a statement block.

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)
 Returns true if lhs and rhs are equal, and false otherwise.
bool operator!= (const Binding &lhs, const Binding &rhs)
 Returns true if lhs and rhs are not equal, and false otherwise.

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 ( )

Constructs a new Binding object.

Definition at line 247 of file qqmlsa.cpp.

◆ Binding() [2/3]

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

Creates a copy of other.

Definition at line 254 of file qqmlsa.cpp.

◆ Binding() [3/3]

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

Move-constructs a Binding instance.

Definition at line 259 of file qqmlsa.cpp.

◆ ~Binding()

QQmlSA::Binding::~Binding ( )
default

Destroys the binding.

Member Function Documentation

◆ attachedType()

Element QQmlSA::Binding::attachedType ( ) const

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

Definition at line 384 of file qqmlsa.cpp.

◆ bindingScope()

Element QQmlSA::Binding::bindingScope ( ) const

Returns the Element scope in which the binding is defined.

Definition at line 342 of file qqmlsa.cpp.

◆ bindingType()

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

Returns the type of this binding.

Definition at line 350 of file qqmlsa.cpp.

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

◆ hasFunctionScriptValue()

bool QQmlSA::Binding::hasFunctionScriptValue ( ) const

Returns whether this binding has script value type function like when it is assigned a (lambda) method, an arrow function or a statement block.

If the content type of this binding is not \l{QQmlSA::BindingType::Script}, returns false.

Definition at line 464 of file qqmlsa.cpp.

◆ hasObject()

bool QQmlSA::Binding::hasObject ( ) const

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

Definition at line 432 of file qqmlsa.cpp.

◆ hasUndefinedScriptValue()

bool QQmlSA::Binding::hasUndefinedScriptValue ( ) const

Returns whether this binding has script value type undefined like when it is assigned undefined.

If the content type of this binding is not \l{QQmlSA::BindingType::Script}, returns false.

Definition at line 451 of file qqmlsa.cpp.

◆ isAttached()

bool QQmlSA::Binding::isAttached ( ) const

Returns true if this type is attached to another one, false otherwise.

Definition at line 375 of file qqmlsa.cpp.

◆ isLiteralBinding()

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

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

Definition at line 475 of file qqmlsa.cpp.

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

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

◆ operator=() [1/2]

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

Move-assigns other to this Binding instance.

Definition at line 282 of file qqmlsa.cpp.

◆ operator=() [2/2]

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

Assigns other to this Binding instance.

Definition at line 266 of file qqmlsa.cpp.

◆ propertyName()

QString QQmlSA::Binding::propertyName ( ) const

Returns the name of the property bound with this binding.

Definition at line 367 of file qqmlsa.cpp.

◆ 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 Invalid.

Definition at line 424 of file qqmlsa.cpp.

◆ sourceLocation()

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

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

Definition at line 405 of file qqmlsa.cpp.

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

◆ operator!=

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

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

Two Bindings are considered equal if their property name, content type, and source location match.

Definition at line 106 of file qqmlsa.h.

◆ operator==

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

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

Two Bindings are considered equal if their property name, content type, and source location match.

Definition at line 102 of file qqmlsa.h.


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