You can directly preview the generated code from the designer by Form -> View Code.

a .ui file is just a XML file describing your Interface. It is then converted into valid C++ code by the uic tool.