开发者

QScriptValue::toVariant but no fromVariant?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜