QLua
Lua-Qt bindings
Public Member Functions
qlua::LuaCBackMethod Class Reference

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>

Collaboration diagram for qlua::LuaCBackMethod:
Collaboration graph
[legend]

List of all members.

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.

Detailed Description

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.


Constructor & Destructor Documentation

qlua::LuaCBackMethod::LuaCBackMethod ( LuaContext lc,
const CBackParameterTypes &  p,
int  luaCBackRef 
) [inline]

Constructor.

Parameters:
lcLuaContext
psignal signature: This information is used to translate the parameter values received from the signal (as an array of void*) into Lua values
luaCBackRefreference (as a Lua integer reference) to Lua function to invoke

Member Function Documentation

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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Enumerations Enumerator