diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2024-02-07 10:48:39 +0100 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2024-03-21 10:41:29 +0100 |
commit | eaad950651c237708c26f3931963c633077ace01 (patch) | |
tree | 119db9ea5f4aed3e8a5e839a652e0be0eb7dc4cb /src/qml/jsapi/qjsvalue.cpp | |
parent | a155476111bb9a16a63131ddbc688a1e02e6c640 (diff) |
Deprecate QJSValue::isVariant
It returns rather unexpected results, see updated documentation for
details.
Amends 8704c640946ac852668638e2980d3e2b78aa27ae
Pick-to: 6.7
Change-Id: I439ae8dd218aa36fe63ac01953c34e5dff66470d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsapi/qjsvalue.cpp')
-rw-r--r-- | src/qml/jsapi/qjsvalue.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index e80208adc5..56ce04c631 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -452,9 +452,18 @@ bool QJSValue::isCallable() const } /*! + \deprecated [6.9] Returns true if this QJSValue is a variant value; otherwise returns false. + \warning This function is likely to give unexpected results. + A variant value is only constructed by the QJSEngine in a very + limited number of cases. This used to be different before Qt + 5.14, where \l{QJSEngine::toScriptValue} would have created + them for more types instead of corresponding ECMAScript types. + You can get a valid \l QVariant via \l toVariant for many values + for which \c{isVariant} returns false. + \sa toVariant() */ bool QJSValue::isVariant() const |