diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-06-16 15:03:33 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2023-06-20 11:38:41 +0200 |
commit | 8c451bba7aa6474c8aaec01b8fb02201e0237835 (patch) | |
tree | 77dd4d480379e964b68d9b1f249dd1dacb5fa314 /src/qml/jsapi/qjsvalue.cpp | |
parent | e50b2069f90542328fbc9917bf0345f30dfa583e (diff) |
QML: Allow conversion of symbols to QVariant
We produce their descriptiveString or simply a QVariant containing a
QJSValue, depending on whether we're supposed to convert objects without
equivalent C++ type or not.
Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-113854
Change-Id: I22b6038c936d860fdd8aa227f9dfe704e3265a77
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsapi/qjsvalue.cpp')
-rw-r--r-- | src/qml/jsapi/qjsvalue.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index 0aaa471e23..dd3bb98002 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -163,10 +163,11 @@ /*! \enum QJSValue::ObjectConversionBehavior - This enum is used to specify how JavaScript objects without an equivalent + This enum is used to specify how JavaScript objects and symbols without an equivalent native Qt type should be treated when converting to QVariant. \value ConvertJSObjects A best-effort, possibly lossy, conversion is attempted. + Symbols are converted to QString. \value RetainJSObjects The value is retained as QJSValue wrapped in QVariant. */ |