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
QQmlJSMetaPropertyBinding Class Reference

\inmodule QtQmlCompiler More...

#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
 A binding is valid when it has both a target (m_propertyName is set) and some content set (m_bindingType != Invalid).
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=QString()) const
 Extracts the information about translations from a binding.
QSharedPointer< const QQmlJSScopeliteralType (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.
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 QQmlJSScopeattachedType () 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

\inmodule QtQmlCompiler

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 519 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 688 of file qqmljsmetatypes_p.h.

◆ QQmlJSMetaPropertyBinding() [3/4]

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

Definition at line 689 of file qqmljsmetatypes_p.h.

◆ QQmlJSMetaPropertyBinding() [4/4]

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

Definition at line 693 of file qqmljsmetatypes_p.h.

Member Function Documentation

◆ attachedType()

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

Definition at line 879 of file qqmljsmetatypes_p.h.

◆ bindingType()

BindingType QQmlJSMetaPropertyBinding::bindingType ( ) const
inline

Definition at line 704 of file qqmljsmetatypes_p.h.

◆ boolValue()

bool QQmlJSMetaPropertyBinding::boolValue ( ) const

Definition at line 31 of file qqmljsmetatypes.cpp.

◆ groupType()

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

Definition at line 871 of file qqmljsmetatypes_p.h.

◆ hasInterceptor()

bool QQmlJSMetaPropertyBinding::hasInterceptor ( ) const
inline

Definition at line 893 of file qqmljsmetatypes_p.h.

◆ hasLiteral()

bool QQmlJSMetaPropertyBinding::hasLiteral ( ) const
inline

Definition at line 887 of file qqmljsmetatypes_p.h.

◆ hasObject()

bool QQmlJSMetaPropertyBinding::hasObject ( ) const
inline

Definition at line 892 of file qqmljsmetatypes_p.h.

◆ hasValueSource()

bool QQmlJSMetaPropertyBinding::hasValueSource ( ) const
inline

Definition at line 897 of file qqmljsmetatypes_p.h.

◆ interceptorType()

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

Definition at line 848 of file qqmljsmetatypes_p.h.

◆ interceptorTypeName()

QString QQmlJSMetaPropertyBinding::interceptorTypeName ( ) const
inline

Definition at line 841 of file qqmljsmetatypes_p.h.

◆ isLiteralBinding()

bool QQmlJSMetaPropertyBinding::isLiteralBinding ( BindingType type)
inlinestatic

Definition at line 680 of file qqmljsmetatypes_p.h.

◆ isValid()

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 26 of file qqmljsmetatypes.cpp.

◆ 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 89 of file qqmljsmetatypes.cpp.

◆ numberValue()

double QQmlJSMetaPropertyBinding::numberValue ( ) const

Definition at line 39 of file qqmljsmetatypes.cpp.

◆ objectType()

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

Definition at line 833 of file qqmljsmetatypes_p.h.

◆ objectTypeName()

QString QQmlJSMetaPropertyBinding::objectTypeName ( ) const
inline

Definition at line 826 of file qqmljsmetatypes_p.h.

◆ propertyName()

QString QQmlJSMetaPropertyBinding::propertyName ( ) const
inline

Definition at line 700 of file qqmljsmetatypes_p.h.

◆ regExpValue()

QString QQmlJSMetaPropertyBinding::regExpValue ( ) const

Definition at line 55 of file qqmljsmetatypes.cpp.

◆ scriptIndex()

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

Definition at line 802 of file qqmljsmetatypes_p.h.

◆ scriptKind()

ScriptBindingKind QQmlJSMetaPropertyBinding::scriptKind ( ) const
inline

Definition at line 810 of file qqmljsmetatypes_p.h.

◆ scriptValueType()

ScriptBindingValueType QQmlJSMetaPropertyBinding::scriptValueType ( ) const
inline

Definition at line 818 of file qqmljsmetatypes_p.h.

◆ setAttachedBinding()

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

Definition at line 728 of file qqmljsmetatypes_p.h.

◆ setBoolLiteral()

void QQmlJSMetaPropertyBinding::setBoolLiteral ( bool value)
inline

Definition at line 734 of file qqmljsmetatypes_p.h.

◆ setGroupBinding()

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

Definition at line 722 of file qqmljsmetatypes_p.h.

◆ setInterceptor()

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

Definition at line 777 of file qqmljsmetatypes_p.h.

◆ setNullLiteral()

void QQmlJSMetaPropertyBinding::setNullLiteral ( )
inline

Definition at line 740 of file qqmljsmetatypes_p.h.

◆ setNumberLiteral()

void QQmlJSMetaPropertyBinding::setNumberLiteral ( double value)
inline

Definition at line 746 of file qqmljsmetatypes_p.h.

◆ setObject()

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

Definition at line 771 of file qqmljsmetatypes_p.h.

◆ setPropertyName()

void QQmlJSMetaPropertyBinding::setPropertyName ( const QString & propertyName)
inline

Definition at line 699 of file qqmljsmetatypes_p.h.

◆ setRegexpLiteral()

void QQmlJSMetaPropertyBinding::setRegexpLiteral ( QAnyStringView value)
inline

Definition at line 752 of file qqmljsmetatypes_p.h.

◆ setScriptBinding()

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

Definition at line 715 of file qqmljsmetatypes_p.h.

◆ setStringLiteral()

void QQmlJSMetaPropertyBinding::setStringLiteral ( QAnyStringView value)
inline

Definition at line 708 of file qqmljsmetatypes_p.h.

◆ setTranslation()

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

Definition at line 758 of file qqmljsmetatypes_p.h.

◆ setTranslationId()

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

Definition at line 765 of file qqmljsmetatypes_p.h.

◆ setValueSource()

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

Definition at line 783 of file qqmljsmetatypes_p.h.

◆ sourceLocation()

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

Definition at line 702 of file qqmljsmetatypes_p.h.

◆ stringValue()

QString QQmlJSMetaPropertyBinding::stringValue ( ) const

Definition at line 47 of file qqmljsmetatypes.cpp.

◆ translationDataValue()

QQmlTranslation QQmlJSMetaPropertyBinding::translationDataValue ( QString qmlFileNameForContext = QString()) 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 70 of file qqmljsmetatypes.cpp.

◆ valueSourceType()

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

Definition at line 863 of file qqmljsmetatypes_p.h.

◆ valueSourceTypeName()

QString QQmlJSMetaPropertyBinding::valueSourceTypeName ( ) const
inline

Definition at line 856 of file qqmljsmetatypes_p.h.

◆ operator!=

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

Definition at line 909 of file qqmljsmetatypes_p.h.

◆ operator==

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

Definition at line 902 of file qqmljsmetatypes_p.h.

◆ qHash

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

Definition at line 914 of file qqmljsmetatypes_p.h.


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