Class QtLuaEngine
is a QObject
subclass representing a Lua interpreter.
This object can be used to add a Lua interpreter to any Qt application
with capabilities comparable to those of the
QtScript
language
and additional support for multi-threaded execution.
Instances of this class can be in one of three state:
QtLuaEngine::Ready
indicates that the interpreter
is ready to accept new Lua commands.
QtLuaEngine::Running
indicates that the interpreter
is currently executing a Lua program.
QtLuaEngine::Paused
indicates that the interpreter
was suspended while executing a Lua program. One can then
use the Lua debug library to investigage the Lua state.
Class QtLuaEngine
provides member functions to
submit Lua strings to the interpreter and to collect
the evaluation results. If these functions are invoked
from the thread owning the Lua engine object,
the Lua code is executed right away.
Otherwise a thread hopping operation
ensures that the execution of a Lua program happens
in the thread owning the Lua engine object.
Class QtLuaLocker
provides means
to directly access the Lua state
lua_State*
using
the Lua API.