[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lqt: Qt bindings update
- From: Leo Razoumov <slonik.az@...>
- Date: Tue, 20 Jan 2009 17:05:56 -0500 (EST)
On Tue, 20 Jan 2009, Peter Kümmel wrote:
Leo Razoumov wrote:
[..snip..]
/*file n1/mylib.c (will become n1/mylib.so) */
But then we need for each namespace a shared library, or I am wrong?
Peter
Actually not. You can put multiple calls to luaL_register into a
single luaopen_XXXX function
int luaopen_Qt(lua_State *pL)
{
luaL_register(pL, "Qt.core", qt_core);
lua_settop(pL, 1); //prevents polluting Lua stack
luaL_register(pL, "Qt.qui", qt_qui);
lua_settop(pL, 1); //prevents polluting Lua stack
luaL_register(pL, "Qt.net", qt_network);
lua_settop(pL, 1); //prevents polluting Lua stack
luaL_register(pL, "Qt.script", qt_script);
....
return 1;
}
now require"Qt" will execute luaopen_Qt and populate all the Qt namespaces
require "Qt"
local myapp= Qt.core.App.new()
local tmp = Qt.gui.foo()
--Leo--
- References:
- Re: lqt: Qt bindings update, Anders Backman
- Re: lqt: Qt bindings update, Mauro Iazzi
- Re: lqt: Qt bindings update, Anders Backman
- Re: lqt: Qt bindings update, Mauro Iazzi
- Re: lqt: Qt bindings update, Anders Backman
- Re: lqt: Qt bindings update, Peter Kümmel
- Re: lqt: Qt bindings update, Peter Kümmel
- Re: lqt: Qt bindings update, Anders Backman
- Re: lqt: Qt bindings update, Peter Kümmel
- Re: lqt: Qt bindings update, Leo Razoumov
- Re: lqt: Qt bindings update, Peter Kümmel