diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-05-09 12:00:03 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-05-11 08:04:02 +0200 |
commit | 2316da3a800428d41432a052280ea0cd26465c2c (patch) | |
tree | 058448cf0b0360f83c7a672052ddc590c3c74ad0 /src/qml/jsapi/qjsprimitivevalue.cpp | |
parent | 60a34c33934e264e42d7aef00500f5ebf7f03bff (diff) |
QmlCompiler: Improve argument construction in generated code
We don't have to pass types that don't fit if we actually have the
correct types in suitable wrappers.
This still invokes the internal conversions of the call frame setup if
we call with really generic types, for example if the same value is read
multiple times with different target types. However, that is acceptable.
Fixes: QTBUG-113465
Change-Id: I8ec4afeb39bbe6585e5268c0e9b0cfd2788d761a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsapi/qjsprimitivevalue.cpp')
-rw-r--r-- | src/qml/jsapi/qjsprimitivevalue.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/qml/jsapi/qjsprimitivevalue.cpp b/src/qml/jsapi/qjsprimitivevalue.cpp index 3ab2ade0dc..0bef52b5d8 100644 --- a/src/qml/jsapi/qjsprimitivevalue.cpp +++ b/src/qml/jsapi/qjsprimitivevalue.cpp @@ -146,6 +146,17 @@ QT_BEGIN_NAMESPACE */ /*! + \fn QJSPrimitiveValue::QJSPrimitiveValue(QMetaType type) + \since 6.6 + \internal + + Creates a QJSPrimitiveValue of type \a type, and initializes with a + default-constructed value if \a type can be stored in QJSPrimtiveValue. + If \a type cannot be stored this results in a QJSPrimitiveValue of type + Undefined. +*/ + +/*! \fn QJSPrimitiveValue::QJSPrimitiveValue(const QVariant &value) Creates a QJSPrimitiveValue from the contents of \a value if those contents |