Obsolete Members for QJSValue

以下成员源于类 QJSValue 被弃用。 提供它们是为使旧源代码能继续工作。强烈建议不要在新代码中使用它们。

公共函数

(deprecated in 6.9) bool isVariant () const

成员函数文档编制

[deprecated in 6.9] bool QJSValue:: isVariant () const

This function is deprecated since 6.9. We strongly advise against using it in new code.

返回 true,若此 QJSValue is a variant value; otherwise returns false.

警告: 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 QJSEngine::toScriptValue would have created them for more types instead of corresponding ECMAScript types. You can get a valid QVariant 凭借 toVariant for many values for which isVariant returns false.

另请参阅 toVariant ().