|
QLua
Lua-Qt bindings
|
C++ method abstraction: Qt signals are connected to instances of this class which invokes associated Lua function through the Invoke method.
More...
#include <LuaCallbackDispatcher.h>

Public Member Functions | |
| LuaCBackMethod (LuaContext *lc, const CBackParameterTypes &p, int luaCBackRef) | |
| Constructor. | |
| void | Invoke (void **arguments) |
| Called by QObject::qt_metacall as part of a signal-method invocation. | |
| int | CBackRef () const |
| Return associated reference to Lua function. | |
C++ method abstraction: Qt signals are connected to instances of this class which invokes associated Lua function through the Invoke method.
At signal connection time a signal is connected to a dynamically created instance of this class which stores internally a reference to the Lua function to invoke.
| qlua::LuaCBackMethod::LuaCBackMethod | ( | LuaContext * | lc, |
| const CBackParameterTypes & | p, | ||
| int | luaCBackRef | ||
| ) | [inline] |
Constructor.
| lc | LuaContext |
| p | signal signature: This information is used to translate the parameter values received from the signal (as an array of void*) into Lua values |
| luaCBackRef | reference (as a Lua integer reference) to Lua function to invoke |
| void qlua::LuaCBackMethod::Invoke | ( | void ** | arguments | ) |
Called by QObject::qt_metacall as part of a signal-method invocation.
Iterates over the list of arguments and parameter types in parallel and for each argument uses the corresponding parameter wrapper to translate and push values onto the Lua stack. Values which are of QObject* type are automatically translated to Lua table. When a QObject is added to the Lua context its life-time is not managed by Lua.
1.7.4