开发者

QScriptValue::toVariant but no fromVariant?

开发者 https://www.devze.com 2023-04-13 09:47 出处:网络
QScriptValue::toVariant can turn basic string and number types, as well as arrays and objects (associative arrays), into a QVariant.

QScriptValue::toVariant can turn basic string and number types, as well as arrays and objects (associative arrays), into a QVariant.

There doesn't seem to be any corresponding way to construct a QScriptValue from a QVariant.

Is it hiding, or m开发者_开发百科issing?


http://qt-project.org/doc/qt-5/qscriptengine.html#newVariant

QScriptValue QScriptEngine::newVariant(const QVariant & value)

Creates a Qt Script object holding the given variant value.

If a default prototype has been registered with the meta type id of value, then the prototype of the created object will be that prototype; otherwise, the prototype will be the Object prototype object.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号