source: trunk/doc/html/uic.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 4.5 KB
Line 
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"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { 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&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;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&nbsp;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
38toolkit. The <em>uic</em> reads a user interface definition
39(.ui) file in XML as generated by <a href="designer-manual.html">Qt
40Designer</a> and creates corresponding C++ header or source files.
41It can also generate an image file to embed raw image data in C++
42source 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>
49uic [options] &lt;file&gt;
50</pre>
51
52<p> Generate implementation:
53<pre>
54uic [options] -impl &lt;headerfile&gt; &lt;file&gt;
55</pre>
56
57<ul>
58<li> &lt;headerfile&gt; - name of the declaration file
59</ul>
60<p> Generate image collection:
61<pre>
62uic [options] -embed &lt;project&gt; &lt;image1&gt; &lt;image2&gt; &lt;image3&gt; ...
63</pre>
64
65<ul>
66<li> &lt;project&gt; - project name
67<li> &lt;image[0..n]&gt; - image files
68</ul>
69<p> For convenience, <em>uic</em> can also generate declaration or
70implementation stubs for subclasses.
71<p> Generate subclass declaration:
72<pre>
73uic [options] -subdecl &lt;classname&gt; &lt;headerfile&gt; &lt;file&gt;
74</pre>
75
76<ul>
77<li> &lt;classname&gt; - name of the subclass to generate
78<li> &lt;headerfile&gt; - declaration file of the <b>baseclass</b>
79</ul>
80<p> Generate subclass implementation:
81<pre>
82uic [options] -subimpl &lt;classname&gt; &lt;headerfile&gt; &lt;file&gt;
83</pre>
84
85<ul>
86<li> &lt;classname&gt; - name of the subclass to generate
87<li> &lt;headerfile&gt; - 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
94generated header file. This is necessary if typedef classes are used.
95<li> <tt>-tr func</tt> - use <tt>func(sourceText, comment)</tt> rather than
96trUtf8(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 $&lt; -o $@
106
107 %.cpp: %.ui
108 uic -impl $*.h $&lt; -o $@
109</pre>
110
111If you want to write portably, you can use individual rules of the
112following form:
113<pre>
114 NAME.h: NAME.ui
115 uic $&lt; -o $@
116
117 NAME.cpp: NAME.ui
118 uic -impl $*.h $&lt; -o $@
119</pre>
120
121You must also remember to add <tt>NAME.cpp</tt> to your SOURCES (substitute
122your 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
124care, 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 &copy; 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>
Note: See TracBrowser for help on using the repository browser.