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::SourceLocation & sourceLocation () 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 QQmlJSScope > 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.
QQmlJSMetaMethod::RelativeFunctionIndex scriptIndex () const
ScriptBindingKind scriptKind () const
ScriptBindingValueType scriptValueType () const
QString objectTypeName () const
QSharedPointer< const QQmlJSScope > objectType () const
QString interceptorTypeName () const
QSharedPointer< const QQmlJSScope > interceptorType () const
QString valueSourceTypeName () const
QSharedPointer< const QQmlJSScope > valueSourceType () const
QSharedPointer< const QQmlJSScope > groupType () const
QSharedPointer< const QQmlJSScope > attachedType () 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 533 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 702 of file qqmljsmetatypes_p.h.

◆ QQmlJSMetaPropertyBinding() [3/4]

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

Definition at line 703 of file qqmljsmetatypes_p.h.

◆ QQmlJSMetaPropertyBinding() [4/4]

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

Definition at line 707 of file qqmljsmetatypes_p.h.

Member Function Documentation

◆ attachedType()

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

Definition at line 893 of file qqmljsmetatypes_p.h.

◆ bindingType()

BindingType QQmlJSMetaPropertyBinding::bindingType ( ) const
inline

Definition at line 718 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 885 of file qqmljsmetatypes_p.h.

◆ hasInterceptor()

bool QQmlJSMetaPropertyBinding::hasInterceptor ( ) const
inline

Definition at line 907 of file qqmljsmetatypes_p.h.

◆ hasLiteral()

bool QQmlJSMetaPropertyBinding::hasLiteral ( ) const
inline

Definition at line 901 of file qqmljsmetatypes_p.h.

◆ hasObject()

bool QQmlJSMetaPropertyBinding::hasObject ( ) const
inline

Definition at line 906 of file qqmljsmetatypes_p.h.

◆ hasValueSource()

bool QQmlJSMetaPropertyBinding::hasValueSource ( ) const
inline

Definition at line 911 of file qqmljsmetatypes_p.h.

◆ interceptorType()

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

Definition at line 862 of file qqmljsmetatypes_p.h.

◆ interceptorTypeName()

QString QQmlJSMetaPropertyBinding::interceptorTypeName ( ) const
inline

Definition at line 855 of file qqmljsmetatypes_p.h.

◆ isLiteralBinding()

bool QQmlJSMetaPropertyBinding::isLiteralBinding ( BindingType type)
inlinestatic

Definition at line 694 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 847 of file qqmljsmetatypes_p.h.

◆ objectTypeName()

QString QQmlJSMetaPropertyBinding::objectTypeName ( ) const
inline

Definition at line 840 of file qqmljsmetatypes_p.h.

◆ propertyName()

QString QQmlJSMetaPropertyBinding::propertyName ( ) const
inline

Definition at line 714 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 816 of file qqmljsmetatypes_p.h.

◆ scriptKind()

ScriptBindingKind QQmlJSMetaPropertyBinding::scriptKind ( ) const
inline

Definition at line 824 of file qqmljsmetatypes_p.h.

◆ scriptValueType()

ScriptBindingValueType QQmlJSMetaPropertyBinding::scriptValueType ( ) const
inline

Definition at line 832 of file qqmljsmetatypes_p.h.

◆ setAttachedBinding()

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

Definition at line 742 of file qqmljsmetatypes_p.h.

◆ setBoolLiteral()

void QQmlJSMetaPropertyBinding::setBoolLiteral ( bool value)
inline

Definition at line 748 of file qqmljsmetatypes_p.h.

◆ setGroupBinding()

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

Definition at line 736 of file qqmljsmetatypes_p.h.

◆ setInterceptor()

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

Definition at line 791 of file qqmljsmetatypes_p.h.

◆ setNullLiteral()

void QQmlJSMetaPropertyBinding::setNullLiteral ( )
inline

Definition at line 754 of file qqmljsmetatypes_p.h.

◆ setNumberLiteral()

void QQmlJSMetaPropertyBinding::setNumberLiteral ( double value)
inline

Definition at line 760 of file qqmljsmetatypes_p.h.

◆ setObject()

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

Definition at line 785 of file qqmljsmetatypes_p.h.

◆ setPropertyName()

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

Definition at line 713 of file qqmljsmetatypes_p.h.

◆ setRegexpLiteral()

void QQmlJSMetaPropertyBinding::setRegexpLiteral ( QAnyStringView value)
inline

Definition at line 766 of file qqmljsmetatypes_p.h.

◆ setScriptBinding()

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

Definition at line 729 of file qqmljsmetatypes_p.h.

◆ setStringLiteral()

void QQmlJSMetaPropertyBinding::setStringLiteral ( QAnyStringView value)
inline

Definition at line 722 of file qqmljsmetatypes_p.h.

◆ setTranslation()

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

Definition at line 772 of file qqmljsmetatypes_p.h.

◆ setTranslationId()

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

Definition at line 779 of file qqmljsmetatypes_p.h.

◆ setValueSource()

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

Definition at line 797 of file qqmljsmetatypes_p.h.

◆ sourceLocation()

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

Definition at line 716 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 877 of file qqmljsmetatypes_p.h.

◆ valueSourceTypeName()

QString QQmlJSMetaPropertyBinding::valueSourceTypeName ( ) const
inline

Definition at line 870 of file qqmljsmetatypes_p.h.

◆ operator!=

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

Definition at line 923 of file qqmljsmetatypes_p.h.

◆ operator==

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

Definition at line 916 of file qqmljsmetatypes_p.h.

◆ qHash

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

Definition at line 928 of file qqmljsmetatypes_p.h.


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