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
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)
 
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 475 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 644 of file qqmljsmetatypes_p.h.

◆ QQmlJSMetaPropertyBinding() [3/4]

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

Definition at line 645 of file qqmljsmetatypes_p.h.

◆ QQmlJSMetaPropertyBinding() [4/4]

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

Definition at line 649 of file qqmljsmetatypes_p.h.

Member Function Documentation

◆ attachingType()

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

Definition at line 835 of file qqmljsmetatypes_p.h.

◆ bindingType()

BindingType QQmlJSMetaPropertyBinding::bindingType ( ) const
inline

Definition at line 660 of file qqmljsmetatypes_p.h.

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

+ Here is the caller graph for this function:

◆ boolValue()

bool QQmlJSMetaPropertyBinding::boolValue ( ) const

Definition at line 21 of file qqmljsmetatypes.cpp.

◆ groupType()

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

Definition at line 827 of file qqmljsmetatypes_p.h.

◆ hasInterceptor()

bool QQmlJSMetaPropertyBinding::hasInterceptor ( ) const
inline

Definition at line 849 of file qqmljsmetatypes_p.h.

◆ hasLiteral()

bool QQmlJSMetaPropertyBinding::hasLiteral ( ) const
inline

Definition at line 843 of file qqmljsmetatypes_p.h.

◆ hasObject()

bool QQmlJSMetaPropertyBinding::hasObject ( ) const
inline

Definition at line 848 of file qqmljsmetatypes_p.h.

◆ hasValueSource()

bool QQmlJSMetaPropertyBinding::hasValueSource ( ) const
inline

Definition at line 853 of file qqmljsmetatypes_p.h.

◆ interceptorType()

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

Definition at line 804 of file qqmljsmetatypes_p.h.

◆ interceptorTypeName()

QString QQmlJSMetaPropertyBinding::interceptorTypeName ( ) const
inline

Definition at line 797 of file qqmljsmetatypes_p.h.

◆ isLiteralBinding()

static bool QQmlJSMetaPropertyBinding::isLiteralBinding ( BindingType type)
inlinestatic

Definition at line 636 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 80 of file qqmljsmetatypes.cpp.

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

+ Here is the call graph for this function:

◆ numberValue()

double QQmlJSMetaPropertyBinding::numberValue ( ) const

Definition at line 29 of file qqmljsmetatypes.cpp.

◆ objectType()

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

Definition at line 789 of file qqmljsmetatypes_p.h.

◆ objectTypeName()

QString QQmlJSMetaPropertyBinding::objectTypeName ( ) const
inline

Definition at line 782 of file qqmljsmetatypes_p.h.

◆ propertyName()

QString QQmlJSMetaPropertyBinding::propertyName ( ) const
inline

Definition at line 656 of file qqmljsmetatypes_p.h.

Referenced by QQmlJSScope::addOwnPropertyBinding().

+ Here is the caller graph for this function:

◆ regExpValue()

QString QQmlJSMetaPropertyBinding::regExpValue ( ) const

Definition at line 45 of file qqmljsmetatypes.cpp.

◆ scriptIndex()

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

Definition at line 758 of file qqmljsmetatypes_p.h.

References QQmlJSMetaMethod::Invalid.

◆ scriptKind()

ScriptBindingKind QQmlJSMetaPropertyBinding::scriptKind ( ) const
inline

Definition at line 766 of file qqmljsmetatypes_p.h.

◆ scriptValueType()

ScriptBindingValueType QQmlJSMetaPropertyBinding::scriptValueType ( ) const
inline

Definition at line 774 of file qqmljsmetatypes_p.h.

References ScriptValue_Unknown.

◆ setAttachedBinding()

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

Definition at line 684 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 690 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 678 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 733 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 696 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 702 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 727 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 655 of file qqmljsmetatypes_p.h.

◆ setRegexpLiteral()

void QQmlJSMetaPropertyBinding::setRegexpLiteral ( QAnyStringView value)
inline

Definition at line 708 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 671 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 664 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 714 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 721 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 739 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 658 of file qqmljsmetatypes_p.h.

Referenced by QQmlJSScope::addOwnPropertyBinding().

+ Here is the caller graph for this function:

◆ stringValue()

QString QQmlJSMetaPropertyBinding::stringValue ( ) const

Definition at line 37 of file qqmljsmetatypes.cpp.

◆ 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 60 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 819 of file qqmljsmetatypes_p.h.

◆ valueSourceTypeName()

QString QQmlJSMetaPropertyBinding::valueSourceTypeName ( ) const
inline

Definition at line 812 of file qqmljsmetatypes_p.h.

Friends And Related Symbol Documentation

◆ operator!=

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

Definition at line 865 of file qqmljsmetatypes_p.h.

◆ operator==

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

Definition at line 858 of file qqmljsmetatypes_p.h.

◆ qHash

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

Definition at line 870 of file qqmljsmetatypes_p.h.


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