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

#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=QString()) 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 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

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 528 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 697 of file qqmljsmetatypes_p.h.

◆ QQmlJSMetaPropertyBinding() [3/4]

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

Definition at line 698 of file qqmljsmetatypes_p.h.

◆ QQmlJSMetaPropertyBinding() [4/4]

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

Definition at line 702 of file qqmljsmetatypes_p.h.

Member Function Documentation

◆ attachedType()

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

Definition at line 888 of file qqmljsmetatypes_p.h.

◆ bindingType()

BindingType QQmlJSMetaPropertyBinding::bindingType ( ) const
inline

Definition at line 713 of file qqmljsmetatypes_p.h.

◆ boolValue()

bool QQmlJSMetaPropertyBinding::boolValue ( ) const

Definition at line 22 of file qqmljsmetatypes.cpp.

◆ groupType()

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

Definition at line 880 of file qqmljsmetatypes_p.h.

◆ hasInterceptor()

bool QQmlJSMetaPropertyBinding::hasInterceptor ( ) const
inline

Definition at line 902 of file qqmljsmetatypes_p.h.

◆ hasLiteral()

bool QQmlJSMetaPropertyBinding::hasLiteral ( ) const
inline

Definition at line 896 of file qqmljsmetatypes_p.h.

◆ hasObject()

bool QQmlJSMetaPropertyBinding::hasObject ( ) const
inline

Definition at line 901 of file qqmljsmetatypes_p.h.

◆ hasValueSource()

bool QQmlJSMetaPropertyBinding::hasValueSource ( ) const
inline

Definition at line 906 of file qqmljsmetatypes_p.h.

◆ interceptorType()

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

Definition at line 857 of file qqmljsmetatypes_p.h.

◆ interceptorTypeName()

QString QQmlJSMetaPropertyBinding::interceptorTypeName ( ) const
inline

Definition at line 850 of file qqmljsmetatypes_p.h.

◆ isLiteralBinding()

bool QQmlJSMetaPropertyBinding::isLiteralBinding ( BindingType type)
inlinestatic

Definition at line 689 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 17 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 81 of file qqmljsmetatypes.cpp.

◆ numberValue()

double QQmlJSMetaPropertyBinding::numberValue ( ) const

Definition at line 30 of file qqmljsmetatypes.cpp.

◆ objectType()

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

Definition at line 842 of file qqmljsmetatypes_p.h.

◆ objectTypeName()

QString QQmlJSMetaPropertyBinding::objectTypeName ( ) const
inline

Definition at line 835 of file qqmljsmetatypes_p.h.

◆ propertyName()

QString QQmlJSMetaPropertyBinding::propertyName ( ) const
inline

Definition at line 709 of file qqmljsmetatypes_p.h.

◆ regExpValue()

QString QQmlJSMetaPropertyBinding::regExpValue ( ) const

Definition at line 46 of file qqmljsmetatypes.cpp.

◆ scriptIndex()

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

Definition at line 811 of file qqmljsmetatypes_p.h.

◆ scriptKind()

ScriptBindingKind QQmlJSMetaPropertyBinding::scriptKind ( ) const
inline

Definition at line 819 of file qqmljsmetatypes_p.h.

◆ scriptValueType()

ScriptBindingValueType QQmlJSMetaPropertyBinding::scriptValueType ( ) const
inline

Definition at line 827 of file qqmljsmetatypes_p.h.

◆ setAttachedBinding()

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

Definition at line 737 of file qqmljsmetatypes_p.h.

◆ setBoolLiteral()

void QQmlJSMetaPropertyBinding::setBoolLiteral ( bool value)
inline

Definition at line 743 of file qqmljsmetatypes_p.h.

◆ setGroupBinding()

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

Definition at line 731 of file qqmljsmetatypes_p.h.

◆ setInterceptor()

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

Definition at line 786 of file qqmljsmetatypes_p.h.

◆ setNullLiteral()

void QQmlJSMetaPropertyBinding::setNullLiteral ( )
inline

Definition at line 749 of file qqmljsmetatypes_p.h.

◆ setNumberLiteral()

void QQmlJSMetaPropertyBinding::setNumberLiteral ( double value)
inline

Definition at line 755 of file qqmljsmetatypes_p.h.

◆ setObject()

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

Definition at line 780 of file qqmljsmetatypes_p.h.

◆ setPropertyName()

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

Definition at line 708 of file qqmljsmetatypes_p.h.

◆ setRegexpLiteral()

void QQmlJSMetaPropertyBinding::setRegexpLiteral ( QAnyStringView value)
inline

Definition at line 761 of file qqmljsmetatypes_p.h.

◆ setScriptBinding()

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

Definition at line 724 of file qqmljsmetatypes_p.h.

◆ setStringLiteral()

void QQmlJSMetaPropertyBinding::setStringLiteral ( QAnyStringView value)
inline

Definition at line 717 of file qqmljsmetatypes_p.h.

◆ setTranslation()

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

Definition at line 767 of file qqmljsmetatypes_p.h.

◆ setTranslationId()

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

Definition at line 774 of file qqmljsmetatypes_p.h.

◆ setValueSource()

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

Definition at line 792 of file qqmljsmetatypes_p.h.

◆ sourceLocation()

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

Definition at line 711 of file qqmljsmetatypes_p.h.

◆ stringValue()

QString QQmlJSMetaPropertyBinding::stringValue ( ) const

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

◆ valueSourceType()

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

Definition at line 872 of file qqmljsmetatypes_p.h.

◆ valueSourceTypeName()

QString QQmlJSMetaPropertyBinding::valueSourceTypeName ( ) const
inline

Definition at line 865 of file qqmljsmetatypes_p.h.

◆ operator!=

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

Definition at line 918 of file qqmljsmetatypes_p.h.

◆ operator==

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

Definition at line 911 of file qqmljsmetatypes_p.h.

◆ qHash

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

Definition at line 923 of file qqmljsmetatypes_p.h.


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