I am using QScriptValue to store a javascript function. I have a C++
method that stores it aside for later use:


void Deferred::onRes(const QScriptValue &v)
{
    m_res = v;

    //  m_res.call());  THIS WOULD WORK
}

- If I invoke call() as in the snippet above, in comments, the
function is called alright.
- If I invoke call() from the same QML method that called onRes, the
call works as well

- HOWEVER, if I invoke it even later (on some signal handler), the
function doesn't get called.

m_res.toString() shows the correct function body in all cases. It's as
if the link to script engine got broken somehow?

Any idea what "spoils" the QScriptValue in this fashion? I have tried
to ensure that nothing gets garbage collected, so I don't think that's
the cause.

-- 
Ville M. Vainio @@ Forum Nokia
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Reply via email to