Chapter 3. UI Compiler Tool (uic-qore)

Qore Qt4 module comes with a UI files compiler. It converts Qt4 designer's user interface files into Qore source code.

Qore source files generated by uic-qore use strong type convention.

Qore code generated by uic-qore follows standard Qt4 ui workflow:

  1. Create a widget, a dialog, or a main window in the designer.

  2. Save it as a *.ui file

  3. run:

Example 3.1. Running ui compiler

uic-qore myfile.ui > myfile.q

The file myfile.q now contains a GUI only related class in the Ui namespace without any additional functionality. You should create a instance yourself:

Example 3.2. Custom dialog construction

# file generated from uic-qore containing a GUI for MyDialog
%imports myfile.q
class MyDialog inherits QDialog, Ui::MyDialog
{
    constructor($parent) : QDialog($parent)
    {
        # setupUi() is a part of the Ui::MyDialog
        # and it must be called before any GUI related actions
        $.setupUi($self);
    }
}
      

Warning

Remember, that any additional changes in the generated source files will be lost when you will run uic-qore again.