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
QQmlJavaScriptExpression Class Referenceabstract

#include <qqmljavascriptexpression_p.h>

+ Inheritance diagram for QQmlJavaScriptExpression:
+ Collaboration diagram for QQmlJavaScriptExpression:

Classes

class  DeleteWatcher
 

Public Member Functions

 QQmlJavaScriptExpression ()
 
virtual ~QQmlJavaScriptExpression ()
 
virtual QString expressionIdentifier () const
 
virtual void expressionChanged ()=0
 
QV4::ReturnedValue evaluate (bool *isUndefined)
 
QV4::ReturnedValue evaluate (QV4::CallData *callData, bool *isUndefined)
 
bool evaluate (void **a, const QMetaType *types, int argc)
 
bool notifyOnValueChanged () const
 
void setNotifyOnValueChanged (bool v)
 
void resetNotifyOnValueChanged ()
 
QObjectscopeObject () const
 
void setScopeObject (QObject *v)
 
virtual QQmlSourceLocation sourceLocation () const
 
bool hasContext () const
 
bool hasValidContext () const
 
QQmlContextpublicContext () const
 
QQmlRefPointer< QQmlContextDatacontext () const
 
void setContext (const QQmlRefPointer< QQmlContextData > &context)
 
void insertIntoList (QQmlJavaScriptExpression **listHead)
 
QV4::Functionfunction () const
 
virtual void refresh ()
 
bool hasError () const
 
bool hasDelayedError () const
 
QQmlError error (QQmlEngine *) const
 
void clearError ()
 
void clearActiveGuards ()
 
QQmlDelayedErrordelayedError ()
 
virtual bool mustCaptureBindableProperty () const
 
QQmlEngineengine () const
 
bool hasUnresolvedNames () const
 
bool needsPropertyChangeTrigger (QObject *target, int propertyIndex)
 
QPropertyChangeTriggerallocatePropertyChangeTrigger (QObject *target, int propertyIndex)
 

Static Public Member Functions

static QV4::ReturnedValue evalFunction (const QQmlRefPointer< QQmlContextData > &ctxt, QObject *scope, const QString &code, const QString &filename, quint16 line)
 

Protected Types

enum  GuardTag { NoGuardTag , NotifyOnValueChanged }
 
enum  Tag { NoTag , InEvaluationLoop }
 

Protected Member Functions

void createQmlBinding (const QQmlRefPointer< QQmlContextData > &ctxt, QObject *scope, const QString &code, const QString &filename, quint16 line)
 
void setupFunction (QV4::ExecutionContext *qmlContext, QV4::Function *f)
 
void setCompilationUnit (const QQmlRefPointer< QV4::ExecutableCompilationUnit > &compilationUnit)
 

Protected Attributes

QBiPointer< QObject, DeleteWatcherm_scopeObject
 
QForwardFieldList< QQmlJavaScriptExpressionGuard, &QQmlJavaScriptExpressionGuard::next, GuardTagactiveGuards
 
QTaggedPointer< QQmlDelayedError, Tagm_error
 
TriggerListqpropertyChangeTriggers = nullptr
 

Friends

class QQmlContextData
 
class QQmlPropertyCapture
 
class QQmlTranslationBindingFromBinding
 
class QQmlTranslationBindingFromTranslationInfo
 
class QQmlJavaScriptExpressionCapture
 
void QQmlJavaScriptExpressionGuard_callback (QQmlNotifierEndpoint *, void **)
 

Detailed Description

Definition at line 65 of file qqmljavascriptexpression_p.h.

Member Enumeration Documentation

◆ GuardTag

Enumerator
NoGuardTag 
NotifyOnValueChanged 

Definition at line 151 of file qqmljavascriptexpression_p.h.

◆ Tag

Enumerator
NoTag 
InEvaluationLoop 

Definition at line 158 of file qqmljavascriptexpression_p.h.

Constructor & Destructor Documentation

◆ QQmlJavaScriptExpression()

QQmlJavaScriptExpression::QQmlJavaScriptExpression ( )

Definition at line 64 of file qqmljavascriptexpression.cpp.

◆ ~QQmlJavaScriptExpression()

QQmlJavaScriptExpression::~QQmlJavaScriptExpression ( )
virtual

Definition at line 72 of file qqmljavascriptexpression.cpp.

References clearActiveGuards(), clearError(), QRecyclePool< T, Step >::Delete(), m_scopeObject, TriggerList::next, and qpropertyChangeTriggers.

+ Here is the call graph for this function:

Member Function Documentation

◆ allocatePropertyChangeTrigger()

QPropertyChangeTrigger * QQmlJavaScriptExpression::allocatePropertyChangeTrigger ( QObject * target,
int propertyIndex )

Definition at line 540 of file qqmljavascriptexpression.cpp.

References engine(), QQmlEnginePrivate::get(), TriggerList::next, and qpropertyChangeTriggers.

Referenced by QQmlPropertyCapture::captureTranslation().

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

◆ clearActiveGuards()

void QQmlJavaScriptExpression::clearActiveGuards ( )

Definition at line 551 of file qqmljavascriptexpression.cpp.

References activeGuards, and QForwardFieldList< N, nextMember, Tag >::takeFirst().

Referenced by ~QQmlJavaScriptExpression(), and setNotifyOnValueChanged().

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

◆ clearError()

void QQmlJavaScriptExpression::clearError ( )
inline

Definition at line 267 of file qqmljavascriptexpression_p.h.

References QTaggedPointer< T, Tag >::data(), and m_error.

Referenced by ~QQmlJavaScriptExpression(), and QQmlBinding::doUpdate().

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

◆ context()

QQmlRefPointer< QQmlContextData > QQmlJavaScriptExpression::context ( ) const
inline

Definition at line 93 of file qqmljavascriptexpression_p.h.

Referenced by QQmlPropertyBindingJS::expressionChanged(), setContext(), QQmlBinding::slowWrite(), QQmlBinding::slowWrite(), and QQmlExpressionPrivate::v4value().

+ Here is the caller graph for this function:

◆ createQmlBinding()

void QQmlJavaScriptExpression::createQmlBinding ( const QQmlRefPointer< QQmlContextData > & ctxt,
QObject * scope,
const QString & code,
const QString & filename,
quint16 line )
protected

Definition at line 487 of file qqmljavascriptexpression.cpp.

References QV4::QmlContext::create(), delayedError(), engine(), error, QQmlEnginePrivate::get(), QJSEngine::handle(), QV4::EngineBase::hasException, line, QV4::Script::parse(), qmlContext(), QV4::ExecutionEngine::rootContext(), setupFunction(), QV4::Script::vmFunction, and QQmlEnginePrivate::warning().

Referenced by QQmlExpressionPrivate::v4value().

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

◆ delayedError()

QQmlDelayedError * QQmlJavaScriptExpression::delayedError ( )

Definition at line 448 of file qqmljavascriptexpression.cpp.

References QTaggedPointer< T, Tag >::data(), and m_error.

Referenced by QQmlJavaScriptExpressionCapture::catchException(), createQmlBinding(), QQmlBinding::doUpdate(), QQmlBinding::slowWrite(), and QQmlBinding::slowWrite().

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

◆ engine()

◆ error()

QQmlError QQmlJavaScriptExpression::error ( QQmlEngine * engine) const

Definition at line 438 of file qqmljavascriptexpression.cpp.

References engine(), QQmlDelayedError::error(), m_error, and Q_UNUSED.

Referenced by QQmlObjectCreator::finalize().

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

◆ evalFunction()

QV4::ReturnedValue QQmlJavaScriptExpression::evalFunction ( const QQmlRefPointer< QQmlContextData > & ctxt,
QObject * scope,
const QString & code,
const QString & filename,
quint16 line )
static

◆ evaluate() [1/3]

QV4::ReturnedValue QQmlJavaScriptExpression::evaluate ( bool * isUndefined)

Definition at line 143 of file qqmljavascriptexpression.cpp.

References engine(), evaluate(), QJSEngine::handle(), and QV4::Encode::undefined().

Referenced by QQmlBinding::evaluate(), QQmlBinding::evaluate(), QQmlPropertyBindingJSForBoundFunction::evaluate(), QQmlBoundSignalExpression::evaluate(), and QQmlBinding::evaluate().

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

◆ evaluate() [2/3]

◆ evaluate() [3/3]

bool QQmlJavaScriptExpression::evaluate ( void ** a,
const QMetaType * types,
int argc )

Definition at line 253 of file qqmljavascriptexpression.cpp.

References QV4::Function::call(), QQmlJavaScriptExpressionCapture::catchException(), engine(), function(), QJSEngine::handle(), Q_ASSERT, qmlEngine(), scopeObject(), and QV4::PersistentValue::valueRef().

+ Here is the call graph for this function:

◆ expressionChanged()

virtual void QQmlJavaScriptExpression::expressionChanged ( )
pure virtual

Implemented in QQmlBinding, QQmlBoundSignalExpression, QQmlExpressionPrivate, and QQmlPropertyBindingJS.

Referenced by QPropertyChangeTrigger::trigger().

+ Here is the caller graph for this function:

◆ expressionIdentifier()

QString QQmlJavaScriptExpression::expressionIdentifier ( ) const
virtual

Reimplemented in QQmlBoundSignalExpression, and QQmlExpressionPrivate.

Definition at line 92 of file qqmljavascriptexpression.cpp.

References QString::asprintf(), function(), QStringLiteral, and url.

+ Here is the call graph for this function:

◆ function()

QV4::Function * QQmlJavaScriptExpression::function ( ) const
inline

Definition at line 105 of file qqmljavascriptexpression_p.h.

Referenced by QQmlBinding::create(), QQmlBinding::doUpdate(), evaluate(), evaluate(), expressionIdentifier(), and QQmlBinding::update().

+ Here is the caller graph for this function:

◆ hasContext()

bool QQmlJavaScriptExpression::hasContext ( ) const
inline

Definition at line 89 of file qqmljavascriptexpression_p.h.

◆ hasDelayedError()

bool QQmlJavaScriptExpression::hasDelayedError ( ) const
inline

Definition at line 262 of file qqmljavascriptexpression_p.h.

References QTaggedPointer< T, Tag >::isNull(), and m_error.

Referenced by QQmlJavaScriptExpressionCapture::catchException().

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

◆ hasError()

bool QQmlJavaScriptExpression::hasError ( ) const
inline

Definition at line 257 of file qqmljavascriptexpression_p.h.

References QTaggedPointer< T, Tag >::isNull(), QQmlDelayedError::isValid(), and m_error.

Referenced by QQmlBinding::doUpdate(), QQmlTranslationBinding::doUpdate(), QQmlObjectCreator::finalize(), QQmlBinding::slowWrite(), QQmlBinding::slowWrite(), QQmlExpressionPrivate::v4value(), and QQmlExpressionPrivate::value().

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

◆ hasUnresolvedNames()

bool QQmlJavaScriptExpression::hasUnresolvedNames ( ) const
inline

Definition at line 134 of file qqmljavascriptexpression_p.h.

Referenced by QQmlObjectCreator::finalize().

+ Here is the caller graph for this function:

◆ hasValidContext()

bool QQmlJavaScriptExpression::hasValidContext ( ) const
inline

Definition at line 90 of file qqmljavascriptexpression_p.h.

Referenced by QQmlBind::setObject(), QQmlBinding::update(), QQuickStateGroupPrivate::updateAutoState(), and QQmlExpressionPrivate::value().

+ Here is the caller graph for this function:

◆ insertIntoList()

void QQmlJavaScriptExpression::insertIntoList ( QQmlJavaScriptExpression ** listHead)
inline

Definition at line 96 of file qqmljavascriptexpression_p.h.

Referenced by QQmlContextData::addExpression().

+ Here is the caller graph for this function:

◆ mustCaptureBindableProperty()

virtual bool QQmlJavaScriptExpression::mustCaptureBindableProperty ( ) const
inlinevirtual

Reimplemented in QQmlBinding, QQmlBoundSignalExpression, QQmlExpressionPrivate, and QQmlPropertyBindingJS.

Definition at line 127 of file qqmljavascriptexpression_p.h.

Referenced by QV4::QObjectWrapper::getProperty().

+ Here is the caller graph for this function:

◆ needsPropertyChangeTrigger()

bool QQmlJavaScriptExpression::needsPropertyChangeTrigger ( QObject * target,
int propertyIndex )

Definition at line 353 of file qqmljavascriptexpression.cpp.

References QRecyclePool< T, Step >::Delete(), TriggerList::next, QPropertyChangeTrigger::propertyIndex, qpropertyChangeTriggers, and QPropertyChangeTrigger::target.

Referenced by QQmlPropertyCapture::captureTranslation().

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

◆ notifyOnValueChanged()

bool QQmlJavaScriptExpression::notifyOnValueChanged ( ) const
inline

Definition at line 240 of file qqmljavascriptexpression_p.h.

References activeGuards, NotifyOnValueChanged, and QForwardFieldList< N, nextMember, Tag >::tag().

Referenced by QQmlJavaScriptExpressionCapture::QQmlJavaScriptExpressionCapture().

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

◆ publicContext()

QQmlContext * QQmlJavaScriptExpression::publicContext ( ) const
inline

Definition at line 91 of file qqmljavascriptexpression_p.h.

◆ refresh()

void QQmlJavaScriptExpression::refresh ( )
virtual

Reimplemented in QQmlBinding.

Definition at line 139 of file qqmljavascriptexpression.cpp.

◆ resetNotifyOnValueChanged()

void QQmlJavaScriptExpression::resetNotifyOnValueChanged ( )

Definition at line 111 of file qqmljavascriptexpression.cpp.

References setNotifyOnValueChanged().

+ Here is the call graph for this function:

◆ scopeObject()

QObject * QQmlJavaScriptExpression::scopeObject ( ) const
inline

Definition at line 245 of file qqmljavascriptexpression_p.h.

References m_scopeObject.

Referenced by QQmlBoundSignalExpression::QQmlBoundSignalExpression(), evalFunction(), evaluate(), evaluate(), QQmlPropertyBindingJS::expressionChanged(), QQmlBoundSignal_callback(), and QQmlExpressionPrivate::v4value().

+ Here is the caller graph for this function:

◆ setCompilationUnit()

void QQmlJavaScriptExpression::setCompilationUnit ( const QQmlRefPointer< QV4::ExecutableCompilationUnit > & compilationUnit)
protected

Definition at line 520 of file qqmljavascriptexpression.cpp.

Referenced by QQmlTranslationBinding::QQmlTranslationBinding().

+ Here is the caller graph for this function:

◆ setContext()

void QQmlJavaScriptExpression::setContext ( const QQmlRefPointer< QQmlContextData > & context)

Definition at line 123 of file qqmljavascriptexpression.cpp.

References QQmlContextData::addExpression(), context(), and QQmlRefPointer< T >::data().

Referenced by QQmlContextData::clearContext(), QQmlExpressionPrivate::init(), and QQmlExpressionPrivate::init().

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

◆ setNotifyOnValueChanged()

void QQmlJavaScriptExpression::setNotifyOnValueChanged ( bool v)

Definition at line 104 of file qqmljavascriptexpression.cpp.

References activeGuards, clearActiveGuards(), NoGuardTag, NotifyOnValueChanged, and QForwardFieldList< N, nextMember, Tag >::setTag().

Referenced by resetNotifyOnValueChanged(), QQmlBinding::setEnabled(), and QQmlBoundSignal::takeExpression().

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

◆ setScopeObject()

void QQmlJavaScriptExpression::setScopeObject ( QObject * v)
inline

Definition at line 251 of file qqmljavascriptexpression_p.h.

References m_scopeObject.

Referenced by QQmlExpressionPrivate::init(), and QQmlExpressionPrivate::init().

+ Here is the caller graph for this function:

◆ setupFunction()

void QQmlJavaScriptExpression::setupFunction ( QV4::ExecutionContext * qmlContext,
QV4::Function * f )
protected

Definition at line 511 of file qqmljavascriptexpression.cpp.

References QQmlContext::engine(), QV4::Function::executableCompilationUnit(), qmlContext(), QQmlRefPointer< T >::reset(), and QV4::PersistentValue::set().

Referenced by createQmlBinding(), and QQmlExpressionPrivate::init().

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

◆ sourceLocation()

QQmlSourceLocation QQmlJavaScriptExpression::sourceLocation ( ) const
virtual

Reimplemented in QQmlBinding, QQmlTranslationBindingFromBinding, and QQmlTranslationBindingFromTranslationInfo.

Definition at line 116 of file qqmljavascriptexpression.cpp.

References QV4::Function::sourceLocation().

Referenced by QQmlData::destroyed(), QQmlPropertyBindingJS::expressionChanged(), QQmlBoundSignalExpression::expressionIdentifier(), and QQmlBinding::sourceLocation().

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

Friends And Related Symbol Documentation

◆ QQmlContextData

friend class QQmlContextData
friend

Definition at line 166 of file qqmljavascriptexpression_p.h.

◆ QQmlJavaScriptExpressionCapture

friend class QQmlJavaScriptExpressionCapture
friend

Definition at line 171 of file qqmljavascriptexpression_p.h.

◆ QQmlJavaScriptExpressionGuard_callback

void QQmlJavaScriptExpressionGuard_callback ( QQmlNotifierEndpoint * ,
void **  )
friend

Definition at line 557 of file qqmljavascriptexpression.cpp.

◆ QQmlPropertyCapture

friend class QQmlPropertyCapture
friend

Definition at line 167 of file qqmljavascriptexpression_p.h.

◆ QQmlTranslationBindingFromBinding

◆ QQmlTranslationBindingFromTranslationInfo

Member Data Documentation

◆ activeGuards

◆ m_error

◆ m_scopeObject

◆ qpropertyChangeTriggers


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