Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
QQmlValueTypeProvider Class Reference

#include <qqmlglobal_p.h>

+ Collaboration diagram for QQmlValueTypeProvider:

Static Public Member Functions

static bool populateValueType (QMetaType targetMetaType, void *target, const QV4::Value &source)
 
static bool populateValueType (QMetaType targetMetaType, void *target, QMetaType sourceMetaType, void *source)
 
static Q_QML_PRIVATE_EXPORT voidheapCreateValueType (const QQmlType &targetType, const QV4::Value &source)
 
static QVariant constructValueType (QMetaType targetMetaType, const QMetaObject *targetMetaObject, int ctorIndex, void *ctorArg)
 
static QVariant createValueType (const QJSValue &, QMetaType)
 
static QVariant createValueType (const QString &, QMetaType)
 
static QVariant createValueType (const QV4::Value &, QMetaType)
 
static QVariant createValueType (const QVariant &, QMetaType)
 

Detailed Description

Definition at line 206 of file qqmlglobal_p.h.

Member Function Documentation

◆ constructValueType()

QVariant QQmlValueTypeProvider::constructValueType ( QMetaType  targetMetaType,
const QMetaObject targetMetaObject,
int  ctorIndex,
void ctorArg 
)
static

Definition at line 626 of file qqmlglobal.cpp.

References createVariantData(), and fromVerifiedType().

Referenced by QQmlPrivate::AOTCompiledContext::constructValueType().

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

◆ createValueType() [1/4]

QVariant QQmlValueTypeProvider::createValueType ( const QJSValue s,
QMetaType  metaType 
)
static

Definition at line 647 of file qqmlglobal.cpp.

References fromJSValue(), isConstructibleMetaType(), and QQmlMetaType::qmlType().

Referenced by constructFromJSValue(), doWriteProperties(), doWriteProperties(), doWriteProperties(), QtObject::font(), QtObject::matrix4x4(), QtObject::matrix4x4(), toVariant(), QV4::SequencePrototype::toVariant(), tryConvertAndAssign(), and QQmlStringConverters::variantFromString().

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

◆ createValueType() [2/4]

QVariant QQmlValueTypeProvider::createValueType ( const QString s,
QMetaType  metaType 
)
static

Definition at line 654 of file qqmlglobal.cpp.

References createVariantData(), fromJSValue(), fromString(), isConstructibleMetaType(), QQmlMetaType::metaObjectForValueType(), mo, and QQmlMetaType::qmlType().

+ Here is the call graph for this function:

◆ createValueType() [3/4]

QVariant QQmlValueTypeProvider::createValueType ( const QV4::Value s,
QMetaType  metaType 
)
static

Definition at line 669 of file qqmlglobal.cpp.

References byProperties(), createVariantData(), fromJSValue(), fromMatchingType(), QJSValuePrivate::fromReturnedValue(), isConstructibleMetaType(), QQmlMetaType::metaObjectForValueType(), mo, QQmlMetaType::qmlType(), and qWarning.

+ Here is the call graph for this function:

◆ createValueType() [4/4]

QVariant QQmlValueTypeProvider::createValueType ( const QVariant s,
QMetaType  metaType 
)
static

This should only be called with either builtin types or wrapped QJSValues as source.

Definition at line 706 of file qqmlglobal.cpp.

References byProperties(), createVariantData(), fromMatchingType(), isConstructibleMetaType(), QQmlMetaType::metaObjectForValueType(), mo, QQmlMetaType::qmlType(), and qWarning.

+ Here is the call graph for this function:

◆ heapCreateValueType()

void * QQmlValueTypeProvider::heapCreateValueType ( const QQmlType targetType,
const QV4::Value source 
)
static

Specialization that constructs the value type on the heap using new and returns a pointer to it.

Definition at line 604 of file qqmlglobal.cpp.

References QMetaType::alignOf(), QMetaType::create(), createOrConstructValueType(), Q_ASSERT, QMetaType::sizeOf(), and QQmlType::typeId().

Referenced by QV4::coerce().

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

◆ populateValueType() [1/2]

bool QQmlValueTypeProvider::populateValueType ( QMetaType  targetMetaType,
void target,
const QV4::Value source 
)
static

Populate the value type in place at target, which is expected to be allocated and default-constructed, for example the result of a QVariant(QMetaType). This is efficient if we can do byProperties() since it can use the pre-constructed object. It also avoids the creation of a QVariant in most cases. It is not efficient if you're going to create a QVariant anyway.

Definition at line 585 of file qqmlglobal.cpp.

References createOrConstructValueType(), QMetaType::destruct(), isConstructibleMetaType(), and QQmlMetaType::qmlType().

Referenced by QV4::ExecutionEngine::metaTypeFromJS(), and populateValueType().

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

◆ populateValueType() [2/2]

bool QQmlValueTypeProvider::populateValueType ( QMetaType  targetMetaType,
void target,
QMetaType  sourceMetaType,
void source 
)
static

Populate the value type in place at target, which is expected to be allocated and default-constructed, for example the result of a QVariant(QMetaType). This is efficient if we can do byProperties() since it can use the pre-constructed object. It also avoids the creation of a QVariant in most cases. It is not efficient if you're going to create a QVariant anyway.

Definition at line 555 of file qqmlglobal.cpp.

References QJSValuePrivate::asReturnedValue(), createOrConstructValueType(), QMetaType::destruct(), isConstructibleMetaType(), populateValueType(), and QQmlMetaType::qmlType().

+ Here is the call graph for this function:

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