Implementing lqt into existing lua implementation

29 views
Skip to first unread message

Daniel Kollmann

unread,
Jun 3, 2012, 6:25:04 AM6/3/12
to lqt-bindings
Hello,

I have some trouble to get lqt be recognised by my LUA implementation.

I have my executable compiling and running but I cannot find the code
that is supposed to register lqt to Lua.

When I search for some keyword from the examples like QApplication, I
cannot find it anywhere in the code.

I created a project for lqt and added the four source files from the
common folder.

I have all the code from https://github.com/mkottman/lqt but I still
have the impression code is missing.

It would be nice if someone could point me into the right direction,
maybe I still have a wrong understanding of how lqt works.

Dan

Michal Kottman

unread,
Jun 3, 2012, 8:19:03 AM6/3/12
to lqt-bi...@googlegroups.com


On Jun 3, 2012 12:25 PM, "Daniel Kollmann" <dkoll...@googlemail.com> wrote:
>
> Hello,
>
> I have some trouble to get lqt be recognised by my LUA implementation.
>
> I have my executable compiling and running but I cannot find the code
> that is supposed to register lqt to Lua.
>
> When I search for some keyword from the examples like QApplication, I
> cannot find it anywhere in the code.

Lqt is a binding *generator* (specifically built for the Qt framework). What you get in the sources is not the binding itself, but a "recipe" to bulid the bindings. To actually build the Lua bindings, you have to have CMake and Qt installed and do this:

lqt$ mkdir build; cd build
lqt/build$ cmake ..; make

This will do 2 things:
- generate the source code of the Lua binding, which will be stored in lqt/build/qt<module>_src/
- build the Lua binding and store it in lqt/build/lib

> I created a project for lqt and added the four source files from the
> common folder.

This is not enough, it is just support code. The binding itself is generated from the Qt headers you have installed, so it is up-to-date with your instaallation (there are some issues with Qt >= 4.7).

If you want to embed lqt in your application, use:

lqt/build$ make qtcore_cpp

To generate the source code for the QtCore module, etc. Then embed all source files in lqt/build/qtcore_src/ to you application and call luaopen_qtcore(L) in your initialization code.

Reply all
Reply to author
Forward
0 new messages