uic(1)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

πŸ’… 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:

  • -o file β€” write the output to file instead of to stdout. 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. πŸ™ˆ
  • -tr func β€” use func() instead of tr() for internationalization. Swap the vibe, keep the function. 🌈
  • -version β€” display the version of uic and 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, the uic doesn't care, so you can use .C, .cc, .CC, .cxx or 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