1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/doc/uic.doc:1 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>User Interface Compiler (uic)</title>
|
---|
7 | <style type="text/css"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { background: #ffffff; color: black; }
|
---|
12 | --></style>
|
---|
13 | </head>
|
---|
14 | <body>
|
---|
15 |
|
---|
16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
17 | <tr bgcolor="#E5E5E5">
|
---|
18 | <td valign=center>
|
---|
19 | <a href="index.html">
|
---|
20 | <font color="#004faf">Home</font></a>
|
---|
21 | | <a href="classes.html">
|
---|
22 | <font color="#004faf">All Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main Classes</font></a>
|
---|
25 | | <a href="annotated.html">
|
---|
26 | <font color="#004faf">Annotated</font></a>
|
---|
27 | | <a href="groups.html">
|
---|
28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
29 | | <a href="functions.html">
|
---|
30 | <font color="#004faf">Functions</font></a>
|
---|
31 | </td>
|
---|
32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>User Interface Compiler (uic)</h1>
|
---|
33 |
|
---|
34 |
|
---|
35 |
|
---|
36 |
|
---|
37 | <p> This page documents the <em>User Interface Compiler</em> for the Qt GUI
|
---|
38 | toolkit. The <em>uic</em> reads a user interface definition
|
---|
39 | (.ui) file in XML as generated by <a href="designer-manual.html">Qt
|
---|
40 | Designer</a> and creates corresponding C++ header or source files.
|
---|
41 | It can also generate an image file to embed raw image data in C++
|
---|
42 | source code.
|
---|
43 | <p> <h2> Options
|
---|
44 | </h2>
|
---|
45 | <a name="1"></a><p> <h3> File Generation Options
|
---|
46 | </h3>
|
---|
47 | <a name="1-1"></a><p> Generate declaration:
|
---|
48 | <pre>
|
---|
49 | uic [options] <file>
|
---|
50 | </pre>
|
---|
51 |
|
---|
52 | <p> Generate implementation:
|
---|
53 | <pre>
|
---|
54 | uic [options] -impl <headerfile> <file>
|
---|
55 | </pre>
|
---|
56 |
|
---|
57 | <ul>
|
---|
58 | <li> <headerfile> - name of the declaration file
|
---|
59 | </ul>
|
---|
60 | <p> Generate image collection:
|
---|
61 | <pre>
|
---|
62 | uic [options] -embed <project> <image1> <image2> <image3> ...
|
---|
63 | </pre>
|
---|
64 |
|
---|
65 | <ul>
|
---|
66 | <li> <project> - project name
|
---|
67 | <li> <image[0..n]> - image files
|
---|
68 | </ul>
|
---|
69 | <p> For convenience, <em>uic</em> can also generate declaration or
|
---|
70 | implementation stubs for subclasses.
|
---|
71 | <p> Generate subclass declaration:
|
---|
72 | <pre>
|
---|
73 | uic [options] -subdecl <classname> <headerfile> <file>
|
---|
74 | </pre>
|
---|
75 |
|
---|
76 | <ul>
|
---|
77 | <li> <classname> - name of the subclass to generate
|
---|
78 | <li> <headerfile> - declaration file of the <b>baseclass</b>
|
---|
79 | </ul>
|
---|
80 | <p> Generate subclass implementation:
|
---|
81 | <pre>
|
---|
82 | uic [options] -subimpl <classname> <headerfile> <file>
|
---|
83 | </pre>
|
---|
84 |
|
---|
85 | <ul>
|
---|
86 | <li> <classname> - name of the subclass to generate
|
---|
87 | <li> <headerfile> - declaration file of the <b>subclass</b>
|
---|
88 | </ul>
|
---|
89 | <p> <h3> General Options
|
---|
90 | </h3>
|
---|
91 | <a name="1-2"></a><p> <ul>
|
---|
92 | <li> <tt>-o file</tt> - write output to 'file' rather than to stdout.
|
---|
93 | <li> <tt>-nofwd</tt> - omit forward declarations of custom classes in the
|
---|
94 | generated header file. This is necessary if typedef classes are used.
|
---|
95 | <li> <tt>-tr func</tt> - use <tt>func(sourceText, comment)</tt> rather than
|
---|
96 | trUtf8(sourceText, comment) for <a href="i18n.html#internationalization">internationalization</a>.
|
---|
97 | <li> <tt>-pch file</tt> - add <tt>#include "file"</tt> as the first statement in the implementation file.
|
---|
98 | </ul>
|
---|
99 | <p> <h2> Usage
|
---|
100 | </h2>
|
---|
101 | <a name="2"></a><p> <em>uic</em> is almost always invoked by <tt>make (1)</tt>, rather than by hand.
|
---|
102 | <p> Here are useful makefile rules if you only use GNU make:
|
---|
103 | <pre>
|
---|
104 | %.h: %.ui
|
---|
105 | uic $< -o $@
|
---|
106 |
|
---|
107 | %.cpp: %.ui
|
---|
108 | uic -impl $*.h $< -o $@
|
---|
109 | </pre>
|
---|
110 |
|
---|
111 | If you want to write portably, you can use individual rules of the
|
---|
112 | following form:
|
---|
113 | <pre>
|
---|
114 | NAME.h: NAME.ui
|
---|
115 | uic $< -o $@
|
---|
116 |
|
---|
117 | NAME.cpp: NAME.ui
|
---|
118 | uic -impl $*.h $< -o $@
|
---|
119 | </pre>
|
---|
120 |
|
---|
121 | You must also remember to add <tt>NAME.cpp</tt> to your SOURCES (substitute
|
---|
122 | your favorite name) variable and <tt>NAME.o</tt> to your OBJECTS variable.
|
---|
123 | <p> (While we prefer to name our C++ source files .cpp, the <em>uic</em> doesn't
|
---|
124 | care, so you can use .C, .cc, .CC, .cxx or even .c++ if you prefer.)
|
---|
125 | <p>
|
---|
126 | <!-- eof -->
|
---|
127 | <p><address><hr><div align=center>
|
---|
128 | <table width=100% cellspacing=0 border=0><tr>
|
---|
129 | <td>Copyright © 2007
|
---|
130 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
131 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
132 | </table></div></address></body>
|
---|
133 | </html>
|
---|