[Qt-interest] QtScript conceptual questions

Sean M. Pappalardo pegasus at renegadetech.com
Thu Jan 15 06:48:31 CET 2009


Hello again.

I have a few high-level questions about QtScript since it seems my
understanding is seriously flawed:

1) Does one need to evaluate() an entire script file before calling
individual functions contained within? (If not, would it hurt to do so?
The point being to report syntax errors at the start of the program
instead of at call time.)

2) When one does QScriptValue slot = execute(functionname); what's
actually happening? Are we making a self-contained object that is the
function? Or simply referencing its instance in the ScriptEngine?

3) When one then does qScriptConnect(object, SIGNAL(signalName()),
QScriptValue(), slot); what's actually happening here? Are we connecting
the signal to a self-contained object?

4) What implications does all this have for multi-threaded code?
Especially considering
http://doc.trolltech.com/4.4/qtscript.html#controlling-qobject-ownership

5) What's the best way to protect against one thread evaluate()ing some
function and a connected signal in another thread evaluate()ing another?


Speak slowly, I'm new to C++. :)

Thanks very much for any help anyone can provide.

Sincerely,
Sean M. Pappalardo

<<--------------------------------------------------------------------------------->>
This E-Mail message has been scanned for viruses
and cleared by >>SmartMail<< from Smarter Technology, Inc.
<<--------------------------------------------------------------------------------->>



More information about the Qt-interest-old mailing list