4.2 The qtlua_uic user interface compiler

This tool is able to compile .ui user interface files produced by the Qt designer tool to lua code.

$ cd examples/lua/hello_uic/
$ qtlua_uic hello.ui > hello_ui.lua

The generated file contains lua code to create widgets, layouts and connect signals. It can be loaded as a lua module which returns the root widget:

ui = require("hello_ui")

Custom widget classes can be registered from the C++ code by calling the State::register_qobject_meta function before loading interface scripts which require them.

QtLua before version 2 was able to load user interface files directly by relying on the QUiLoader Qt class. This feature is still available but support for custom widget classes is more complicated (see Qt doc).

Valid XHTML 1.0 StrictGenerated by diaxen on Sat Mar 30 15:29:54 2013 using MkDoc