[Qt-interest] Mapping objects to qscript

Scott Sibley sisibley at gmail.com
Thu Oct 15 19:23:05 CEST 2009


Is there a way to do this? I want both uptime and cpuinfo to be under the
same property 'lcd'. The following doesn't work. I didn't expect it to, but
I needed an example.

    uptime = new PluginUptime();
    cpuinfo = new PluginCpuinfo();

    obj = new QObject();
    val = engine.newObject();

    QScriptValue objVal = engine.newQObject(val, uptime);
    engine.globalObject().setProperty("lcd", objVal);

    val = engine.newObject();
    objVal = engine.newQObject(val, cpuinfo);
    engine.globalObject().setProperty("lcd", objVal);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091015/e25f2a01/attachment.html 


More information about the Qt-interest-old mailing list