Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QScriptEngine using newFunction() on non-static functions.
Qnoobish last edited by
As the title says, I am wondering if it's possible to use the newFunction() method and wrap a non-static member function of a class I have.
For example...right now I am able to wrap a static C++ function by doing something like this:
@QScriptValue ProcessStart = myScriptEngine->newFunction( &ScriptEngineCommandList::ProcessStart );@
but I when I try to do the same by using a function reference in a class instance like this:
@QScriptValue ProcessStart = myScriptEngine->newFunction( &myInstance->ProcessStart );@
I get the error "Illegal operation on bound member function expression".
I wonder if it is possible to do this with non-static member functions of a class instance or maybe I am referencing the adress in a wrong way...
Thanks in advance any comment is very welcome.
ilean last edited by
I'm afraid it's not possible.
I'm adding scripting into my app using prototypes to wrap objects. Take a took to it.