uic(1)
π uic(1) β the Qt user interface compiler, bestie edition β¨
General Commands Manual energy, but make it cute. Sit down, grab a boba, and let's talk about uic β the Qt User Interface Compiler. π«Ά
π NAME π
uic β the Qt user interface compiler. That's it, that's the name, and honestly? Iconic.
β¨ SYNOPSIS β¨
uic [options] file
π¦ DESCRIPTION π¦
Okay so this page is literally the whole lore dump for the User Interface Compiler for the Qt GUI toolkit. Here's the tea: uic reads a user interface definition (.ui) file in XML β the kind that Qt Designer generates for you β and it creates the matching C++ header or source files. No cap. It can also generate an image file that embeds raw image data straight into C++ source code. Versatile queen. π
Here's how you generate a declaration:
uic [options] <file>
And here's how you generate an implementation:
uic [options] -impl <headerfile> <file>
<headerfile>: name of the declaration file
And now, for your image collection era:
uic [options] -embed <project> <image1> <image2> <image3> ...
<project>: project name
<image[1..n]>: image files
Because she's generous, uic can also generate declaration or implementation stubs for subclasses. She does it all, fr fr. π
Generate a subclass declaration:
uic [options] -subdecl <subclassname> <baseclassheaderfile> <file>
<subclassname>: name of the subclass to generate
<baseclassheaderfile>: declaration file of the baseclass
Generate a subclass implementation:
uic [options] -subimpl <subclassname> <subclassheaderfile> <file>
<subclassname>: name of the subclass to generate
<subclassheaderfile>: declaration file of the subclass
πΈ GENERAL OPTIONS πΈ
The general options, bestie. Choose your fighter:
-ofileβ write the output tofileinstead of tostdout. Your output, your destination, your rules. π«-nofwdβ omit forward declarations of custom classes in the generated header file. This is necessary if typedef classes are used. Not optional-optional, like actually needed. Lowkey important. π-trfuncβ usefunc()instead oftr()for internationalization. Swap the vibe, keep the function. π-versionβ display the version ofuicand exit. A little "who am I" moment, then she's out. π
π USAGE π
Real talk: uic is almost always invoked by make(1), rather than by hand. She's a behind-the-scenes main character, and we respect that. β¨
Here are useful makefile rules if you only use GNU make:
%.h: %.ui
uic $< -o $@
%.cpp: %.ui
uic -impl $*.h $< -o $@
If you want to write portably, you can use individual rules of the following form:
NAME.h: NAME.ui
uic $< -o $@
NAME.cpp: NAME.ui
uic -impl $*.h $< -o $@
You must also remember to add NAME.cpp to your SOURCES variable (substitute your favorite name) and NAME.o to your OBJECTS variable. Don't forget, bestie, the build will simply not slay otherwise. π
(While we prefer to name our C++ source files.cpp, theuicdoesn't care, so you can use.C,.cc,.CC,.cxxor even.c++if you prefer.) She's not judgy. She's just built different. π§
π₯ SEE ALSO π₯
π AUTHOR π
Trolltech ASA <info@trolltech.com> β the originators, the founders of the feast, the blueprint. π
And that's the whole page, bestie. Mwah. π
This little love letter to uic came from Trolltech AS and is dated 2 Aug 2001 β yes, that's the uic(1) manual page, and she ate. Periodt. π
π¦ where this page comes from
- fedora 43: qt3-devel-docs 3.3.8b-102.fc43 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- fedora 44: qt3-devel-docs 3.3.8b-103.fc44 Β· QPL-1.0 OR GPL-2.0-only OR GPL-3.0-only
- Copyright (C) 2000-2007 Trolltech ASA. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms