|
LibreCAD
|
QObject wrapper for Lua Allow connecting Qt signals with Lua functions. More...
#include <luaqobject.h>


Public Member Functions | |
| LuaQObject (QObject *object) | |
| Create QObject wrapper. More... | |
| ~LuaQObject () | |
| bool | connect (int signalId, LuaIntf::LuaRef slot) |
| Connect Qt slot to Lua function. More... | |
| void | pushArg (LuaIntf::LuaState s, int const type, void const *arg) |
| Add signal parameter. More... | |
| std::string | objectName () |
| Get object name. More... | |
| QObject * | findChild (std::string name) |
| Find children by name. More... | |
| bool | valid () |
| Return object validity. More... | |
| int | qt_metacall (QMetaObject::Call c, int id, void **a) |
| Internal Qt function This function is called when a slot of this object is called. It gets the arguments and call the Lua function. More... | |
Static Public Member Functions | |
| static std::string | objectName (QObject *object) |
| Get object name. More... | |
| static QObject * | findChild (QObject *object, std::string name) |
| Find children by name. More... | |
Private Attributes | |
| QObject * | _object |
| int | _slotId |
| int | _signalId |
| LuaIntf::LuaRef | _slotFunction |
| bool | _valid |
QObject wrapper for Lua Allow connecting Qt signals with Lua functions.
Definition at line 19 of file luaqobject.h.
| LuaQObject::LuaQObject | ( | QObject * | object | ) |
Create QObject wrapper.
| object | Pointer to QObject to wrap |
Definition at line 3 of file luaqobject.cpp.
| LuaQObject::~LuaQObject | ( | ) |
Definition at line 12 of file luaqobject.cpp.
| bool LuaQObject::connect | ( | int | signalId, |
| LuaIntf::LuaRef | slot | ||
| ) |
Connect Qt slot to Lua function.
| signalId | Object signal ID |
| slot | Lua function |
Definition at line 16 of file luaqobject.cpp.
| QObject * LuaQObject::findChild | ( | std::string | name | ) |
Find children by name.
| name | Children name |
Definition at line 86 of file luaqobject.cpp.
|
static |
Find children by name.
| object | Pointer to QObject |
| name | Children name |
Definition at line 74 of file luaqobject.cpp.
| std::string LuaQObject::objectName | ( | ) |
|
static |
Get object name.
| object | Pointer to QObject |
Definition at line 61 of file luaqobject.cpp.
| void LuaQObject::pushArg | ( | LuaIntf::LuaState | s, |
| int const | type, | ||
| void const * | arg | ||
| ) |
Add signal parameter.
| s | Lua state |
| type | Qt QMetaType ID |
| arg | Pointer to arg Push a signal parameter to Lua stack |
Definition at line 94 of file luaqobject.cpp.
| int LuaQObject::qt_metacall | ( | QMetaObject::Call | c, |
| int | id, | ||
| void ** | a | ||
| ) |
Internal Qt function This function is called when a slot of this object is called. It gets the arguments and call the Lua function.
Definition at line 33 of file luaqobject.cpp.
| bool LuaQObject::valid | ( | ) |
Return object validity.
Definition at line 152 of file luaqobject.cpp.
|
private |
Definition at line 85 of file luaqobject.h.
|
private |
Definition at line 88 of file luaqobject.h.
|
private |
Definition at line 89 of file luaqobject.h.
|
private |
Definition at line 87 of file luaqobject.h.
|
private |
Definition at line 91 of file luaqobject.h.