diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-03-14 14:51:36 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-03-17 15:01:15 +0100 |
commit | 53998de985710b5ef5f1a8eddd4550a29841f347 (patch) | |
tree | cb54a722e4cb6cabad1a373dd2390572c34cbd2c /src/qml/jsapi/qjsprimitivevalue.cpp | |
parent | 677cd24de676f4fe8542a671357e968285739de5 (diff) |
QJSPrimitiveValue: Add data(), metaType() and a generic coercion method
This allows us to do some more specialized lookups in QmlCompiler.
Change-Id: I7947c8e7bccfa57aee949b080a531a88fd47c8af
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsapi/qjsprimitivevalue.cpp')
-rw-r--r-- | src/qml/jsapi/qjsprimitivevalue.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/qml/jsapi/qjsprimitivevalue.cpp b/src/qml/jsapi/qjsprimitivevalue.cpp index 772ae49db8..12bd304ef4 100644 --- a/src/qml/jsapi/qjsprimitivevalue.cpp +++ b/src/qml/jsapi/qjsprimitivevalue.cpp @@ -273,6 +273,39 @@ QT_BEGIN_NAMESPACE result. */ +/*! + \fn QMetaType QJSPrimitiveValue::metaType() const + \since 6.6 + + Returns the QMetaType of the value stored in the QJSPrimitiveValue. + */ + +/*! + \fn const void *QJSPrimitiveValue::constData() const + \fn const void *QJSPrimitiveValue::data() const + \since 6.6 + + Returns a pointer to the contained value as a generic void* that cannot be + written to. + */ + +/*! + \fn const void *QJSPrimitiveValue::data() + \since 6.6 + + Returns a pointer to the contained data as a generic void* that can be + written to. +*/ + +/*! + \fn template <Type type> QJSPrimiteiveValue QJSPrimitiveValue::to() + + Coerces the value to the specified \a type and returns the result as a new + QJSPrimitiveValue. + + \sa toBoolean(), toInteger(), toDouble(), toString() +*/ + QString QJSPrimitiveValue::toString(double d) { QString result; |