Qt Designer's .ui files are a form of XML files. They follow a certain Document Type Definition (DTD), which is called UI. This chapter is not a formal specification of the DTD but a verbal description of how these files are constructed and what syntax they follow. This information will enable you to quickly change things directly in the files without having to start Qt Designer or even mass-manipulate .ui files with Perl scripts or other text manipulation tools. It is also conceivable to have a tool that extracts translatable strings from the .ui files, even though Qt has other methods for this that apply at a later stage (namely, on the generated source files).
Each .ui file consists of the following parts in this order:
The literal string <!DOCTYPE UI><UI>
Header elements
Exactly one <widget> element that describes the top-level widget of the form
Optionally, a collection of pixmaps in an <images> element
Optionally, a section that describes the used custom widgets
Optionally, a section on the defined connections and slots
Optionally, a section on the tab-chain
The literal string </UI>
We'll now cover all these parts one by one.
The header elements describe general information about the form. All of them are optional.
If this element is specified, its content is used as the name of the class that uic generates. Otherwise, the name of the top-level widget is used.
If you have entered a comment in the Form Settings dialog, this is where it will appear. It will not appear in the generated source code, however.
This element contains information about the author of the form. This information will not appear in the generated source code, however.
If you have specified additional include files in the Form Settings dialog, this is where they will appear.
If you have specified a function for loading pixmaps, this element names it. This also means that the images are not listed in the <images> element described later in this chapter.