Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QQmlJSMetaPropertyBinding Class Reference

#include <qqmljsmetatypes_p.h>

+ Collaboration diagram for QQmlJSMetaPropertyBinding:

Public Member Functions

 QQmlJSMetaPropertyBinding ()
 
 QQmlJSMetaPropertyBinding (QQmlJS::SourceLocation location)
 
 QQmlJSMetaPropertyBinding (QQmlJS::SourceLocation location, const QString &propName)
 
 QQmlJSMetaPropertyBinding (QQmlJS::SourceLocation location, const QQmlJSMetaProperty &prop)
 
void setPropertyName (const QString &propertyName)
 
QString propertyName () const
 
const QQmlJS::SourceLocationsourceLocation () const
 
BindingType bindingType () const
 
bool isValid () const
 
void setStringLiteral (QAnyStringView value)
 
void setScriptBinding (QQmlJSMetaMethod::RelativeFunctionIndex value, ScriptBindingKind kind, ScriptBindingValueType valueType=ScriptBindingValueType::ScriptValue_Unknown)
 
void setGroupBinding (const QSharedPointer< const QQmlJSScope > &groupScope)
 
void setAttachedBinding (const QSharedPointer< const QQmlJSScope > &attachingScope)
 
void setBoolLiteral (bool value)
 
void setNullLiteral ()
 
void setNumberLiteral (double value)
 
void setRegexpLiteral (QAnyStringView value)
 
void setTranslation (QStringView text, QStringView comment, QStringView context, int number)
 
void setTranslationId (QStringView id, int number)
 
void setObject (const QString &typeName, const QSharedPointer< const QQmlJSScope > &type)
 
void setInterceptor (const QString &typeName, const QSharedPointer< const QQmlJSScope > &type)
 
void setValueSource (const QString &typeName, const QSharedPointer< const QQmlJSScope > &type)
 
QString literalTypeName () const
 
bool boolValue () const
 
double numberValue () const
 
QString stringValue () const
 
QString regExpValue () const
 
QQmlTranslation translationDataValue (QString qmlFileNameForContext=QStringLiteral("")) const
 Extracts the information about translations from a binding.
 
QSharedPointer< const QQmlJSScopeliteralType (const QQmlJSTypeResolver *resolver) const
 
QQmlJSMetaMethod::RelativeFunctionIndex scriptIndex () const
 
ScriptBindingKind scriptKind () const
 
ScriptBindingValueType scriptValueType () const
 
QString objectTypeName () const
 
QSharedPointer< const QQmlJSScopeobjectType () const
 
QString interceptorTypeName () const
 
QSharedPointer< const QQmlJSScopeinterceptorType () const
 
QString valueSourceTypeName () const
 
QSharedPointer< const QQmlJSScopevalueSourceType () const
 
QSharedPointer< const QQmlJSScopegroupType () const
 
QSharedPointer< const QQmlJSScopeattachingType () const
 
bool hasLiteral () const
 
bool hasObject () const
 
bool hasInterceptor () const
 
bool hasValueSource () const
 

Static Public Member Functions

static bool isLiteralBinding (BindingType type)
 

Friends

bool operator== (const QQmlJSMetaPropertyBinding &a, const QQmlJSMetaPropertyBinding &b)
 
bool operator!= (const QQmlJSMetaPropertyBinding &a, const QQmlJSMetaPropertyBinding &b)
 
size_t qHash (const QQmlJSMetaPropertyBinding &binding, size_t seed=0)
 

Detailed Description

Represents a single QML binding of a specific type. Typically, when you create a new binding, you know all the details of it already, so you should just set all the data at once.

Definition at line 458 of file qqmljsmetatypes_p.h.

Constructor & Destructor Documentation

◆ QQmlJSMetaPropertyBinding() [1/4]

QQmlJSMetaPropertyBinding::QQmlJSMetaPropertyBinding ( )
default

◆ QQmlJSMetaPropertyBinding() [2/4]

QQmlJSMetaPropertyBinding::QQmlJSMetaPropertyBinding ( QQmlJS::SourceLocation  location)
inline

Definition at line 627 of file qqmljsmetatypes_p.h.

◆ QQmlJSMetaPropertyBinding() [3/4]

QQmlJSMetaPropertyBinding::QQmlJSMetaPropertyBinding ( QQmlJS::SourceLocation  location,
const QString propName 
)
inlineexplicit

Definition at line 628 of file qqmljsmetatypes_p.h.

◆ QQmlJSMetaPropertyBinding() [4/4]

QQmlJSMetaPropertyBinding::QQmlJSMetaPropertyBinding ( QQmlJS::SourceLocation  location,
const QQmlJSMetaProperty prop 
)
inlineexplicit

Definition at line 632 of file qqmljsmetatypes_p.h.

Member Function Documentation

◆ attachingType()

QSharedPointer< const QQmlJSScope > QQmlJSMetaPropertyBinding::attachingType ( ) const
inline

Definition at line 820 of file qqmljsmetatypes_p.h.

Referenced by QQmlSA::Binding::attachingType().

+ Here is the caller graph for this function:

◆ bindingType()

BindingType QQmlJSMetaPropertyBinding::bindingType ( ) const
inline

Definition at line 643 of file qqmljsmetatypes_p.h.

Referenced by QQmlSA::Binding::bindingType(), isValid(), literalType(), and QQmlJSImportVisitor::parseBindingExpression().

+ Here is the caller graph for this function:

◆ boolValue()

bool QQmlJSMetaPropertyBinding::boolValue ( ) const

Definition at line 36 of file qqmljsmetatypes.cpp.

◆ groupType()

QSharedPointer< const QQmlJSScope > QQmlJSMetaPropertyBinding::groupType ( ) const
inline

Definition at line 812 of file qqmljsmetatypes_p.h.

Referenced by QQmlSA::Binding::groupType().

+ Here is the caller graph for this function:

◆ hasInterceptor()

bool QQmlJSMetaPropertyBinding::hasInterceptor ( ) const
inline

Definition at line 834 of file qqmljsmetatypes_p.h.

◆ hasLiteral()

bool QQmlJSMetaPropertyBinding::hasLiteral ( ) const
inline

Definition at line 828 of file qqmljsmetatypes_p.h.

◆ hasObject()

bool QQmlJSMetaPropertyBinding::hasObject ( ) const
inline

Definition at line 833 of file qqmljsmetatypes_p.h.

Referenced by QQmlSA::Binding::hasObject().

+ Here is the caller graph for this function:

◆ hasValueSource()

bool QQmlJSMetaPropertyBinding::hasValueSource ( ) const
inline

Definition at line 838 of file qqmljsmetatypes_p.h.

◆ interceptorType()

QSharedPointer< const QQmlJSScope > QQmlJSMetaPropertyBinding::interceptorType ( ) const
inline

Definition at line 789 of file qqmljsmetatypes_p.h.

◆ interceptorTypeName()

QString QQmlJSMetaPropertyBinding::interceptorTypeName ( ) const
inline

Definition at line 782 of file qqmljsmetatypes_p.h.

◆ isLiteralBinding()

static bool QQmlJSMetaPropertyBinding::isLiteralBinding ( BindingType  type)
inlinestatic

Definition at line 619 of file qqmljsmetatypes_p.h.

◆ isValid()

QT_BEGIN_NAMESPACE bool QQmlJSMetaPropertyBinding::isValid ( ) const

A binding is valid when it has both a target (m_propertyName is set) and some content set (m_bindingType != Invalid).

Definition at line 16 of file qqmljsmetatypes.cpp.

References bindingType(), QQmlSA::Invalid, and QString::isEmpty().

Referenced by QQmlJSImportVisitor::parseBindingExpression().

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

◆ literalType()

QSharedPointer< const QQmlJSScope > QQmlJSMetaPropertyBinding::literalType ( const QQmlJSTypeResolver resolver) const

Uses resolver to return the correct type for the stored literal and a null scope pointer if the binding does not contain a literal

Definition at line 95 of file qqmljsmetatypes.cpp.

References bindingType(), QQmlJSTypeResolver::boolType(), QQmlJSTypeResolver::nullType(), Q_ASSERT, QQmlJSTypeResolver::stringType(), and QQmlJSTypeResolver::typeForName().

Referenced by QQmlSA::Binding::literalType().

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

◆ literalTypeName()

QString QQmlJSMetaPropertyBinding::literalTypeName ( ) const

Definition at line 21 of file qqmljsmetatypes.cpp.

◆ numberValue()

double QQmlJSMetaPropertyBinding::numberValue ( ) const

Definition at line 44 of file qqmljsmetatypes.cpp.

Referenced by QQmlSA::Binding::numberValue().

+ Here is the caller graph for this function:

◆ objectType()

QSharedPointer< const QQmlJSScope > QQmlJSMetaPropertyBinding::objectType ( ) const
inline

Definition at line 774 of file qqmljsmetatypes_p.h.

Referenced by QQmlSA::Binding::objectType().

+ Here is the caller graph for this function:

◆ objectTypeName()

QString QQmlJSMetaPropertyBinding::objectTypeName ( ) const
inline

Definition at line 767 of file qqmljsmetatypes_p.h.

◆ propertyName()

QString QQmlJSMetaPropertyBinding::propertyName ( ) const
inline

Definition at line 639 of file qqmljsmetatypes_p.h.

Referenced by QQmlJSScope::addOwnPropertyBinding(), and QQmlSA::Binding::propertyName().

+ Here is the caller graph for this function:

◆ regExpValue()

QString QQmlJSMetaPropertyBinding::regExpValue ( ) const

Definition at line 60 of file qqmljsmetatypes.cpp.

◆ scriptIndex()

QQmlJSMetaMethod::RelativeFunctionIndex QQmlJSMetaPropertyBinding::scriptIndex ( ) const
inline

Definition at line 743 of file qqmljsmetatypes_p.h.

References QQmlJSMetaMethod::Invalid.

◆ scriptKind()

ScriptBindingKind QQmlJSMetaPropertyBinding::scriptKind ( ) const
inline

Definition at line 751 of file qqmljsmetatypes_p.h.

Referenced by QQmlSA::Binding::scriptKind().

+ Here is the caller graph for this function:

◆ scriptValueType()

ScriptBindingValueType QQmlJSMetaPropertyBinding::scriptValueType ( ) const
inline

Definition at line 759 of file qqmljsmetatypes_p.h.

References ScriptValue_Unknown.

◆ setAttachedBinding()

void QQmlJSMetaPropertyBinding::setAttachedBinding ( const QSharedPointer< const QQmlJSScope > &  attachingScope)
inline

Definition at line 667 of file qqmljsmetatypes_p.h.

Referenced by createNonUniqueScopeBinding().

+ Here is the caller graph for this function:

◆ setBoolLiteral()

void QQmlJSMetaPropertyBinding::setBoolLiteral ( bool  value)
inline

Definition at line 673 of file qqmljsmetatypes_p.h.

Referenced by QQmlJSImportVisitor::parseBindingExpression().

+ Here is the caller graph for this function:

◆ setGroupBinding()

void QQmlJSMetaPropertyBinding::setGroupBinding ( const QSharedPointer< const QQmlJSScope > &  groupScope)
inline

Definition at line 661 of file qqmljsmetatypes_p.h.

Referenced by createNonUniqueScopeBinding().

+ Here is the caller graph for this function:

◆ setInterceptor()

void QQmlJSMetaPropertyBinding::setInterceptor ( const QString typeName,
const QSharedPointer< const QQmlJSScope > &  type 
)
inline

Definition at line 716 of file qqmljsmetatypes_p.h.

References typeName.

Referenced by QQmlJSImportVisitor::endVisit().

+ Here is the caller graph for this function:

◆ setNullLiteral()

void QQmlJSMetaPropertyBinding::setNullLiteral ( )
inline

Definition at line 679 of file qqmljsmetatypes_p.h.

Referenced by QQmlJSImportVisitor::parseBindingExpression().

+ Here is the caller graph for this function:

◆ setNumberLiteral()

void QQmlJSMetaPropertyBinding::setNumberLiteral ( double  value)
inline

Definition at line 685 of file qqmljsmetatypes_p.h.

Referenced by QQmlJSImportVisitor::parseBindingExpression().

+ Here is the caller graph for this function:

◆ setObject()

void QQmlJSMetaPropertyBinding::setObject ( const QString typeName,
const QSharedPointer< const QQmlJSScope > &  type 
)
inline

Definition at line 710 of file qqmljsmetatypes_p.h.

References typeName.

Referenced by QQmlJSImportVisitor::addDefaultProperties(), QQmlJSImportVisitor::endVisit(), and QQmlJSImportVisitor::endVisit().

+ Here is the caller graph for this function:

◆ setPropertyName()

void QQmlJSMetaPropertyBinding::setPropertyName ( const QString propertyName)
inline

Definition at line 638 of file qqmljsmetatypes_p.h.

◆ setRegexpLiteral()

void QQmlJSMetaPropertyBinding::setRegexpLiteral ( QAnyStringView  value)
inline

Definition at line 691 of file qqmljsmetatypes_p.h.

Referenced by QQmlJSImportVisitor::parseBindingExpression().

+ Here is the caller graph for this function:

◆ setScriptBinding()

void QQmlJSMetaPropertyBinding::setScriptBinding ( QQmlJSMetaMethod::RelativeFunctionIndex  value,
ScriptBindingKind  kind,
ScriptBindingValueType  valueType = ScriptBindingValueType::ScriptValue_Unknown 
)
inline

Definition at line 654 of file qqmljsmetatypes_p.h.

Referenced by QQmlJSImportVisitor::parseBindingExpression(), and QQmlJSImportVisitor::visit().

+ Here is the caller graph for this function:

◆ setStringLiteral()

void QQmlJSMetaPropertyBinding::setStringLiteral ( QAnyStringView  value)
inline

Definition at line 647 of file qqmljsmetatypes_p.h.

Referenced by handleTranslationBinding(), and QQmlJSImportVisitor::parseBindingExpression().

+ Here is the caller graph for this function:

◆ setTranslation()

void QQmlJSMetaPropertyBinding::setTranslation ( QStringView  text,
QStringView  comment,
QStringView  context,
int  number 
)
inline

Definition at line 697 of file qqmljsmetatypes_p.h.

References context, number, text, and QStringView::toString().

Referenced by handleTranslationBinding().

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

◆ setTranslationId()

void QQmlJSMetaPropertyBinding::setTranslationId ( QStringView  id,
int  number 
)
inline

Definition at line 704 of file qqmljsmetatypes_p.h.

References number.

Referenced by handleTranslationBinding().

+ Here is the caller graph for this function:

◆ setValueSource()

void QQmlJSMetaPropertyBinding::setValueSource ( const QString typeName,
const QSharedPointer< const QQmlJSScope > &  type 
)
inline

Definition at line 722 of file qqmljsmetatypes_p.h.

References typeName.

Referenced by QQmlJSImportVisitor::endVisit().

+ Here is the caller graph for this function:

◆ sourceLocation()

const QQmlJS::SourceLocation & QQmlJSMetaPropertyBinding::sourceLocation ( ) const
inline

Definition at line 641 of file qqmljsmetatypes_p.h.

Referenced by QQmlJSScope::addOwnPropertyBinding(), and QQmlSA::Binding::sourceLocation().

+ Here is the caller graph for this function:

◆ stringValue()

QString QQmlJSMetaPropertyBinding::stringValue ( ) const

Definition at line 52 of file qqmljsmetatypes.cpp.

Referenced by QQmlSA::Binding::stringValue().

+ Here is the caller graph for this function:

◆ translationDataValue()

QQmlTranslation QQmlJSMetaPropertyBinding::translationDataValue ( QString  qmlFileNameForContext = QStringLiteral("")) const

Extracts the information about translations from a binding.

An additional context string is needed for text based translation (e.g. with qsTr()) and can be obtained from the name of the qml file.

See also
QQmlTranslation

Definition at line 75 of file qqmljsmetatypes.cpp.

References context, and QQmlTranslation::contextFromQmlFilename().

+ Here is the call graph for this function:

◆ valueSourceType()

QSharedPointer< const QQmlJSScope > QQmlJSMetaPropertyBinding::valueSourceType ( ) const
inline

Definition at line 804 of file qqmljsmetatypes_p.h.

◆ valueSourceTypeName()

QString QQmlJSMetaPropertyBinding::valueSourceTypeName ( ) const
inline

Definition at line 797 of file qqmljsmetatypes_p.h.

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const QQmlJSMetaPropertyBinding a,
const QQmlJSMetaPropertyBinding b 
)
friend

Definition at line 850 of file qqmljsmetatypes_p.h.

◆ operator==

bool operator== ( const QQmlJSMetaPropertyBinding a,
const QQmlJSMetaPropertyBinding b 
)
friend

Definition at line 843 of file qqmljsmetatypes_p.h.

◆ qHash

size_t qHash ( const QQmlJSMetaPropertyBinding binding,
size_t  seed = 0 
)
friend

Definition at line 855 of file qqmljsmetatypes_p.h.


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