QLua
Lua-Qt bindings
Classes | Functions
qlua Namespace Reference

QLua namespace. More...

Classes

struct  QArgConstructor
 Interface for constructor objects which generate C++ values from Lua values read from the Lua stack. More...
class  IntQArgConstructor
 QArgConstructor implementation for integer type. More...
class  FloatQArgConstructor
 QArgConstructor implementation for float type. More...
class  DoubleQArgConstructor
 QArgConstructor implementation for double type. More...
class  StringQArgConstructor
 QArgConstructor implementation for QString type. More...
class  VariantMapQArgConstructor
 QArgConstructor implementation for QVariantMap type. More...
class  VariantListQArgConstructor
 QArgConstructor implementation for QVariantList type. More...
class  ObjectStarQArgConstructor
 QArgConstructor implementation for QObject* type. More...
class  WidgetStarQArgConstructor
 QArgConstructor implementation for QWidget* type. More...
class  VoidStarQArgConstructor
 QArgConstructor implementation for void* type. More...
class  ListQArgConstructor
 QArgConstructor implementation for QList<T> type. More...
class  VectorQArgConstructor
 QArgConstructor implementation for QVector<T> type. More...
class  StringListQArgConstructor
 QArgConstructor implementation for QStringList type. More...
class  LArgConstructor
 Abstract base class for return constructors which create Lua values from C++ values. More...
class  IntLArgConstructor
 LArgConstructor implementation for integer type. More...
class  DoubleLArgConstructor
 LArgConstructor implementation for double type. More...
class  FloatLArgConstructor
 LArgConstructor implementation for float type. More...
class  StringLArgConstructor
 LArgConstructor implementation for QString type. More...
class  VoidLArgConstructor
 LArgConstructor implementation for void type. More...
class  VariantMapLArgConstructor
 LArgConstructor implementation for QVariantMap type. More...
class  VariantListLArgConstructor
 LArgConstructor implementation for QVariantList type. More...
class  ObjectStarLArgConstructor
 LArgConstructor implementation for QObject* type. More...
class  WidgetStarLArgConstructor
 LArgConstructor implementation for QWidget* type. More...
class  VoidStarLArgConstructor
 LArgConstructor implementation for void* type. More...
class  ListLArgConstructor
 LArgConstructor implementation for QList<T> type. More...
class  VectorLArgConstructor
 LArgConstructor implementation for QVector<T> type. More...
class  StringListLArgConstructor
 LArgConstructor implementation for QStringList type. More...
class  QArgWrapper
 Wrapper for parameters in a QObject method invocation. More...
class  LArgWrapper
 Wrapper for objects returned from QObject method invocation or passes to Lua callbacks in response to emitted signals. More...
class  LuaCBackMethod
 C++ method abstraction: Qt signals are connected to instances of this class which invokes associated Lua function through the Invoke method. More...
class  LuaCallbackDispatcher
 Manages Lua function invocation through Qt signals. And connection of Qt signals to Lua functions or QObject methods. More...
struct  LuaDefaultSignatureMapper
 Default mapper for method signature; returns name of method. More...
class  LuaContext
 Lua context. Creates or wraps an existing Lua state. More...

Functions

QArgWrappers GenerateQArgWrappers (const ArgumentTypes &at)
 Generate QArgWrapper list from parameter type names as returned by QMetaMethod::parameterTypes().
LArgWrapper GenerateLArgWrapper (const QString &typeName)
 Create LArgWrapper instance from type name.
template<typename T >
GetValue (const LuaContext &lc, const QString &name)
template<typename T >
QList< T > GetValues (const LuaContext &lc, const QString &name)
 Extract list of number.
template<>
QString GetValue< QString > (const LuaContext &lc, const QString &name)
 Extract string.
template<>
QVariantMap GetValue< QVariantMap > (const LuaContext &lc, const QString &name)
 Extract Lua table as variant map.
template<>
QVariantList GetValue< QVariantList > (const LuaContext &lc, const QString &name)
 Extract Lua table as variant list.
template<>
QStringList GetValue< QStringList > (const LuaContext &lc, const QString &name)
 Extract Lua table as string list.
QVariant LuaValueToQVariant (lua_State *L, int idx)
template<typename T >
QList< T > ParseLuaTableAsNumberList (lua_State *L, int stackTableIndex)
 Create QList<T> from Lua table where T is int short float or double.
QStringList ParseLuaTableAsStringList (lua_State *L, int stackTableIndex)
 Create QStringList from Lua table.
template<typename T >
QVector< T > ParseLuaTableAsNumberVector (lua_State *L, int stackTableIndex)
 QVector<T> from Lua table where T is int short float or double.
QVariantMap ParseLuaTable (lua_State *L, int stackTableIndex, bool removeTable=true)
 Create QVariantMap from Lua table.
QVariantList ParseLuaTableAsVariantList (lua_State *L, int stackTableIndex)
 Create QVariantList from Lua table.
void VariantMapToLuaTable (const QVariantMap &vm, lua_State *L)
 Create Lua table from QVariantMap and push it on the Lua stack.
void VariantListToLuaTable (const QVariantList &vl, lua_State *L)
 Create Lua table from QVariantList and push it on the Lua stack.
void VariantToLuaValue (const QVariant &v, lua_State *L)
 Create Lua value from QVariant and push it on the Lua stack.
template<typename T >
void NumberListToLuaTable (const QList< T > &l, lua_State *L)
 Create Lua table from QList<T> where T is a number and push it on the Lua stack.
template<typename T >
void NumberVectorToLuaTable (const QVector< T > &v, lua_State *L)
 Create Lua table from QVector<T> where T is a number and push it on the Lua stack.
void StringListToLuaTable (const QStringList &sl, lua_State *L)
 Create Lua table from QStringList and push it on the Lua stack.

Detailed Description

QLua namespace.


Function Documentation

template<typename T >
T qlua::GetValue ( const LuaContext &  lc,
const QString &  name 
)

Extract C++ value from Lua context.

Template Parameters:
Ttype of returned value
Parameters:
lcLuaContext
nameglobal name of variable in Lua context
QVariant qlua::LuaValueToQVariant ( lua_State *  L,
int  idx 
) [inline]

Create QVariant from Lua value

Parameters:
LLua state
idxindex of value in Lua table
template<typename T >
void qlua::NumberListToLuaTable ( const QList< T > &  l,
lua_State *  L 
)

Create Lua table from QList<T> where T is a number and push it on the Lua stack.

Parameters:
lQList
LLua state
template<typename T >
void qlua::NumberVectorToLuaTable ( const QVector< T > &  v,
lua_State *  L 
)

Create Lua table from QVector<T> where T is a number and push it on the Lua stack.

Parameters:
vQVector
LLua state
QVariantMap qlua::ParseLuaTable ( lua_State *  L,
int  stackTableIndex,
bool  removeTable = true 
) [inline]

Create QVariantMap from Lua table.

Parameters:
LLua State
stackTableIndexindex of table in Lua stack
removeTableif @ true table is removed from stack, this is useful when revursively invoking the function to guarantee that after it returns no table is left on the stack.
template<typename T >
QList< T > qlua::ParseLuaTableAsNumberList ( lua_State *  L,
int  stackTableIndex 
)

Create QList<T> from Lua table where T is int short float or double.

Parameters:
LLua State
stackTableIndexindex of table in Lua stack
template<typename T >
QVector< T > qlua::ParseLuaTableAsNumberVector ( lua_State *  L,
int  stackTableIndex 
)

QVector<T> from Lua table where T is int short float or double.

Parameters:
LLua State
stackTableIndexindex of table in Lua stack
QStringList qlua::ParseLuaTableAsStringList ( lua_State *  L,
int  stackTableIndex 
) [inline]

Create QStringList from Lua table.

Parameters:
LLua state
stackTableIndexindex of table in Lua stack
QVariantList qlua::ParseLuaTableAsVariantList ( lua_State *  L,
int  stackTableIndex 
) [inline]

Create QVariantList from Lua table.

Parameters:
LLua State
stackTableIndexindex of table in Lua stack
void qlua::StringListToLuaTable ( const QStringList &  sl,
lua_State *  L 
) [inline]

Create Lua table from QStringList and push it on the Lua stack.

Parameters:
slQStringList
LLua state
void qlua::VariantListToLuaTable ( const QVariantList &  vl,
lua_State *  L 
) [inline]

Create Lua table from QVariantList and push it on the Lua stack.

Parameters:
vlQVariantList
LLua state
void qlua::VariantMapToLuaTable ( const QVariantMap &  vm,
lua_State *  L 
) [inline]

Create Lua table from QVariantMap and push it on the Lua stack.

Parameters:
vmQVariantMap
LLua state
void qlua::VariantToLuaValue ( const QVariant &  v,
lua_State *  L 
) [inline]

Create Lua value from QVariant and push it on the Lua stack.

Parameters:
vQVariant
LLua state
 All Classes Namespaces Files Functions Variables Enumerations Enumerator