Signal/slot always requires objects.
You will need to add a QObject to your scripting environment, with
QScriptEngine* eng ..;
..
MyObject* myobject = new MyObject();
QObject::connect(myobject,
SIGNAL(finished
()),
this,
SLOT(calculationFinished
()));
eng->globalObject().setProperty("myobject", eng->newQObject(myobject));
eng->evaluate( .. calculation script .. );
QScriptEngine* eng ..;
..
MyObject* myobject = new MyObject();
QObject::connect(myobject,SIGNAL(finished()),this,SLOT(calculationFinished()));
eng->globalObject().setProperty("myobject", eng->newQObject(myobject));
eng->evaluate( .. calculation script .. );
To copy to clipboard, switch view to plain text mode
That myobject could also hold the required parameters for your calculation..
I assume, you have put the scriptengine into another thread. Because if you call eng->evaluate directly, it won't return until the calculation is finished and you can emit your signal directly afterwards..
Joh
Bookmarks