Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 112b0974ad288f6cd55bf971ee6026a9 > files > 660

libqt3-devel-3.0.2-2mdk.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/tools/designer/book/chap-ui-format.leaf:3 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Reference: The .ui File Format</title>
<style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">Home</font></a>
 | <a href="classes.html">
<font color="#004faf">All&nbsp;Classes</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">Main&nbsp;Classes</font></a>
 | <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
 | <a href="groups.html">
<font color="#004faf">Grouped&nbsp;Classes</font></a>
 | <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><p align="right">[<a href="designer-manual-14.html">Prev: Reference: Windows</a>] [<a href="designer-manual.html">Home</a>]</p>
<h2 align="center">Reference: The .ui File Format</h2>
<p><em>Qt Designer</em> stores forms in <tt>.ui</tt> files. These files use an XML format to represent form elements and their characteristics. This document provides an overview of the XML format used, and should provide enough information for developers to write their own <tt>.ui</tt> parsers so that they can read and modify <tt>.ui</tt> files programatically.</p>
<p>One way to parse a <tt>.ui</tt> file is to use Qt and the QDom class; this is how <em>Qt Designer</em> does it: see the <tt>resource.h</tt> and <tt>resource.cpp</tt> source files.</p>
<p>The doctype of a <tt>.ui</tt> file is simply "UI", so the doctype tag is:</p>
<pre>
&lt;DOCTYPE "UI"&gt;
</pre>
<p>The root element is a "UI", which encloses the entire contents:</p>
<pre>
&lt;UI version="3.0" stdsetdef="1"&gt;
...
&lt;/UI&gt;
</pre>
<p>Within the UI entity, there may one or zero of the following element types:</p>
<ul><li><p><a href="designer-manual-15.html#1-1">actions</a> - actions, for QMainWindow forms</p>
<li><p><a href="designer-manual-15.html#1-2">author</a> - the form's author</p>
<li><p><a href="designer-manual-15.html#1-3">class</a> - the form's class name</p>
<li><p><a href="designer-manual-15.html#1-4">comment</a> - comments, e.g. copyright notices</p>
<li><p><a href="designer-manual-15.html#1-5">connections</a> - signal/slot connections</p>
<li><p><a href="designer-manual-15.html#1-6">customwidgets</a> - custom widgets</p>
<li><p><a href="designer-manual-15.html#1-7">exportmacro</a> - ###</p>
<li><p><a href="designer-manual-15.html#1-8">forwards</a> - forward declarations</p>
<li><p><a href="designer-manual-15.html#1-9">images</a> - embedded images: only for <tt>.ui</tt> files than include embedded images; images are normally stored in a separate <tt>images</tt> directory</p>
<li><p><a href="designer-manual-15.html#1-10">includes</a> - include files</p>
<li><p><a href="designer-manual-15.html#1-11">layoutdefaults</a> - default values for layout attributes</p>
<li><p><a href="designer-manual-15.html#1-12">menubar</a> - menu bar, for QMainWindow forms</p>
<li><p><a href="designer-manual-15.html#1-13">pixmapfunction</a> - the name of the function to use for retrieving pixmaps if neither embedded nor external pixmaps are being used</p>
<li><p><a href="designer-manual-15.html#1-14">pixmapinproject</a> - an element whose presence ndicates that the pixmaps are handled by the <tt>.pro</tt> file</p>
<li><p><a href="designer-manual-15.html#1-15">signals</a> - signal declarations</p>
<li><p><a href="designer-manual-15.html#1-16">slots</a> - slot declarations</p>
<li><p><a href="designer-manual-15.html#1-17">tabstops</a> - the form's tab order</p>
<li><p><a href="designer-manual-15.html#1-18">toolbars</a> - toolbars, for QMainWindow forms</p>
<li><p><a href="designer-manual-15.html#1-19">variables</a> - class variables</p>
<li><p><a href="designer-manual-15.html#1-20">widget</a> - the form itself; this element may contain other elements, including other <tt>widget</tt> elements</p>
<li><p><a href="designer-manual-15.html#1-21">forward</a> - Qt 3.x beta backwards compatibility</p>
<li><p><a href="designer-manual-15.html#1-22">include</a> - Qt 2.x backwards compatibility</p>
<li><p><a href="designer-manual-15.html#1-23">variable</a> - Qt 3.x beta backwards compatibility</p>
</ul><p>The ordering of elements is arbitrary, although it is common for the <a href="designer-manual-15.html#1-3">class</a> element to be first.</p>
<h3><a name="1"></a>UI Elements</h3>
<a name="actions"></a><h4><a name="1-1"></a>actions</h4>
<p>This element is used to store the form's actions. It only occurs in QMainWindow forms.</p>
<p>The <tt>actions</tt> element contains one or more <tt>action</tt> elements. Each <tt>action</tt> element contains one or more properties. Each property has a <tt>name</tt> attribute, and a single value which is contained within a datatype element.</p>
<pre>
&lt;actions&gt;
    &lt;action&gt;
        &lt;property name="name"&gt;
            &lt;cstring&gt;fileNewAction&lt;/cstring&gt;
        &lt;/property&gt;
        &lt;property name="iconSet"&gt;
            &lt;iconset&gt;filenew&lt;/iconset&gt;
        &lt;/property&gt;
        &lt;property name="text"&gt;
            &lt;string&gt;New&lt;/string&gt;
        &lt;/property&gt;
        &lt;property name="menuText"&gt;
            &lt;string&gt;&amp;amp;New&lt;/string&gt;
        &lt;/property&gt;
        &lt;property name="accel"&gt;
            &lt;number&gt;4194382&lt;/number&gt;
        &lt;/property&gt;
    &lt;/action&gt;
    ...
&lt;/actions&gt;
</pre>
<a name="author"></a><h4><a name="1-2"></a>author</h4>
<p>This element is used to store the author's name as a simple string.</p>
<pre>
&lt;author&gt;Barney Rubble&lt;/author&gt;
</pre>
<a name="class"></a><h4><a name="1-3"></a>class</h4>
<p>This element is used to store the form's class name as a simple string.</p>
<pre>
&lt;class&gt;InsuranceForm&lt;/class&gt;
</pre>
<a name="comment"></a><h4><a name="1-4"></a>comment</h4>
<p>This element is used to store comments, for example, copyright notices, as a simple string.</p>
<pre>
&lt;comment&gt;*********************************************************************
** Copyright (C) 2002 Trolltech AS.  All rights reserved.
**
** This file is part of Qt Designer.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
*********************************************************************&lt;/comment&gt;
&lt;/comment&gt;
</pre>
<a name="connections"></a><h4><a name="1-5"></a>connections</h4>
<p>This element is used to record the signals and slots connections in the form.</p>
<p>The <tt>connections</tt> element contains one or more <tt>connection</tt> elements and one or more <tt>slot</tt> elements. Each <tt>connection</tt> element identifies the signaling object and its signal, and the receiving object and its slot. Each <tt>slot</tt> element provides a slot's signature.</p>
<pre>
&lt;connections&gt;
    ...
    &lt;connection language="C++"&gt;
        &lt;sender&gt;alignActionGroup&lt;/sender&gt;
        &lt;signal&gt;selected(QAction*)&lt;/signal&gt;
        &lt;receiver&gt;EditorForm&lt;/receiver&gt;
        &lt;slot&gt;changeAlignment(QAction*)&lt;/slot&gt;
    &lt;/connection&gt;
    ...
    &lt;slot access="public" specifier="virtual" language="C++" 
	returnType="void"&gt;changeAlignment(QAction* align)&lt;/slot&gt;
    ...
&lt;/connections&gt;
</pre>
<a name="customwidgets"></a><h4><a name="1-6"></a>customwidgets</h4>
<a name="exportmacro"></a><h4><a name="1-7"></a>exportmacro</h4>
<p>### TODO</p>
<a name="forwards"></a><h4><a name="1-8"></a>forwards</h4>
<p>### TODO</p>
<a name="images"></a><h4><a name="1-9"></a>images</h4>
<p>### TODO</p>
<a name="includes"></a><h4><a name="1-10"></a>includes</h4>
<p>### TODO</p>
<a name="layoutdefaults"></a><h4><a name="1-11"></a>layoutdefaults</h4>
<p>### TODO</p>
<a name="menubar"></a><h4><a name="1-12"></a>menubar</h4>
<p>### TODO</p>
<a name="pixmapfunction"></a><h4><a name="1-13"></a>pixmapfunction</h4>
<p>### TODO</p>
<a name="pixmapinproject"></a><h4><a name="1-14"></a>pixmapinproject</h4>
<p>### TODO</p>
<a name="signals"></a><h4><a name="1-15"></a>signals</h4>
<p>### TODO</p>
<a name="slots"></a><h4><a name="1-16"></a>slots</h4>
<p>### TODO</p>
<a name="tabstops"></a><h4><a name="1-17"></a>tabstops</h4>
<p>### TODO</p>
<a name="toolbars"></a><h4><a name="1-18"></a>toolbars</h4>
<p>### TODO</p>
<a name="variables"></a><h4><a name="1-19"></a>variables</h4>
<p>### TODO</p>
<a name="widget"></a><h4><a name="1-20"></a>widget</h4>
<p>### TODO</p>
<a name="forward"></a><h4><a name="1-21"></a>forward</h4>
<p>### TODO</p>
<a name="include"></a><h4><a name="1-22"></a>include</h4>
<p>### TODO</p>
<a name="variable"></a><h4><a name="1-23"></a>variable</h4>
<p>### TODO</p>
<a name="datatype"></a><h3><a name="2"></a>Datatype Elements</h3>
<a name="color"></a><ul><li><p><tt>bool</tt> - a boolean value (0 or 1), e.g. <tt>&lt;bool&gt;1&lt;/bool&gt;</tt></p>
<li><p><tt>color</tt> - a color, e.g. <tt>&lt;color&gt;&lt;red&gt;192&lt;/red&gt;&lt;green&gt;0&lt;/green&gt;&lt;blue&gt;255&lt;/blue&gt;&lt;/color&gt;</tt></p>
<li><p><tt>cstring</tt> - a C string value (8-bit), e.g. <tt>&lt;cstring&gt;Some text&lt;/cstring&gt;</tt></p>
<li><p><tt>cursor</tt> - an integer which indicates the cursor type, e.g. <tt>&lt;cursor&gt;4&lt;/cursor&gt;</tt>. The valid integers for the cursor type are:</p>
<ul><li><p>0 - ArrowCursor</p>
<li><p>1 - UpArrowCursor</p>
<li><p>2 - CrossCursor</p>
<li><p>3 - WaitCursor</p>
<li><p>4 - IbeamCursor</p>
<li><p>5 - SizeVerCursor</p>
<li><p>6 - SizeHorCursor</p>
<li><p>7 - SizeBDiagCursor</p>
<li><p>8 - SizeFDiagCursor</p>
<li><p>9 - SizeAllCursor</p>
<li><p>10 - BlankCursor</p>
<li><p>11 - SplitVCursor</p>
<li><p>12 - SplitHCursor</p>
<li><p>13 - PointingHandCursor</p>
<li><p>14 - ForbiddenCursor</p>
</ul><li><p><tt>enum</tt> - an enum name, e.g. <tt>&lt;enum&gt;StrongFocus&lt;/enum&gt;</tt></p>
<li><p><tt>font</tt> - a font description, e.g.</p>
<pre>
&lt;font&gt;
    &lt;family&gt;Helvetica&lt;/family&gt;
    &lt;pointsize&gt;16&lt;/pointsize&gt;
    &lt;weight&gt;50&lt;/weight&gt;
    &lt;italic&gt;1&lt;/italic&gt;
    &lt;underline&gt;0&lt;/underline&gt;
    &lt;strikeout&gt;0&lt;/strikeout&gt;
&lt;/font&gt;
</pre>
<li><p><tt>iconset</tt> - an iconset (see <tt>pixmap</tt>), e.g. <tt>&lt;iconset&gt;filenew&lt;/iconset&gt;</tt></p>
<li><p><tt>number</tt> - an integer with an optional sign, e.g. <tt>&lt;number&gt;947&lt;/number&gt;</tt></p>
<li><p><tt>palette</tt> - a <a href="qwidget.html#palette-prop">palette</a></p>
<li><p><tt>pixmap</tt> - a pixmap, normally the name or "key" of the pixmap; the name is used if pixmaps are stored in the project, the key is used if a user defined function is used to access the pixmap. It is also possible for pixmaps to be included inline. Example: <tt>&lt;pixmap&gt;chair&lt;/pixmap&gt;</tt></p>
<li><p><tt>point</tt> - a point, e.g. <tt>&lt;point&gt;&lt;x&gt;15&lt;/x&gt;&lt;y&gt;95&lt;/y&gt;&lt;/point&gt;</tt></p>
<li><p><tt>rect</tt> - a rectangle, e.g.</p>
<pre>
&lt;rect&gt;
    &lt;x&gt;20&lt;/x&gt;
    &lt;y&gt;35&lt;/y&gt;
    &lt;width&gt;225&lt;/width&gt;
    &lt;height&gt;45&lt;/height&gt;
&lt;/rect&gt;
</pre>
<li><p><tt>set</tt> - a list of names separated by |'s, e.g. <tt>&lt;set&gt;AlignLeft|AlignTop&lt;/set&gt;</tt></p>
<li><p><tt>size</tt> - a size, e.g. <tt>&lt;size&gt;&lt;width&gt;150&lt;/width&gt;&lt;height&gt;105&lt;/height&gt;&lt;/size&gt;</tt></p>
<li><p><tt>sizepolicy</tt> - an integer which indicates the size type, e.g. <tt>&lt;hsizetype&gt;5&lt;/hsizetype&gt;&lt;vsizetype&gt;4&lt;/vsizetype&gt;</tt>. The valid integers for the size type are:</p>
<ul><li><p>0 - Fixed</p>
<li><p>1 - Minimum</p>
<li><p>3 - MinimumExpanding</p>
<li><p>4 - Maximum</p>
<li><p>5 - Preferred</p>
<li><p>7 - Expanding</p>
</ul><li><p><tt>string</tt> - a Unicode string value (in UTF8), e.g. <tt>&lt;string&gt;Some text&lt;/string&gt;</tt></p>
</ul><h4><a name="2-1"></a>Complex Datatype Elements</h4>
<a name="palette"></a><h5><a name="2-1-1"></a>palette</h5>
<p>This element holds colors for user interface elements for each color group. For example:</p>
<pre>
&lt;palette&gt;
  &lt;active&gt;
    &lt;color&gt; ... Foreground    ... &lt;/color&gt;
    &lt;color&gt; ... Button        ... &lt;/color&gt;
    &lt;color&gt; ... Light         ... &lt;/color&gt;
    &lt;color&gt; ... Midlight      ... &lt;/color&gt;
    &lt;color&gt; ... Dark	      ... &lt;/color&gt;
    &lt;color&gt; ... Mid	      ... &lt;/color&gt;
    &lt;color&gt; ... Text          ... &lt;/color&gt;
    &lt;color&gt; ... BrightText    ... &lt;/color&gt;
    &lt;color&gt; ... ButtonText    ... &lt;/color&gt;
    &lt;color&gt; ... Base          ... &lt;/color&gt;
    &lt;color&gt; ... Background    ... &lt;/color&gt;
    &lt;color&gt; ... Shadow	      ... &lt;/color&gt;
    &lt;color&gt; ... Highlight     ... &lt;/color&gt;
    &lt;color&gt; ... HighlightText ... &lt;/color&gt;
  &lt;/active&gt;
  &lt;disabled&gt;
    &lt;color&gt;&lt;red&gt;128&lt;/red&gt;&lt;green&gt;128&lt;/green&gt;&lt;blue&gt;128&lt;/blue&gt;&lt;/color&gt;
    ...
    &lt;color&gt;&lt;red&gt;255&lt;/red&gt;&lt;green&gt;255&lt;/green&gt;&lt;blue&gt;255&lt;/blue&gt;&lt;/color&gt;
  &lt;/disabled&gt;
  &lt;inactive&gt;
    &lt;color&gt;&lt;red&gt;0&lt;/red&gt;&lt;green&gt;0&lt;/green&gt;&lt;blue&gt;0&lt;/blue&gt;&lt;/color&gt;
    ...
    &lt;color&gt;&lt;red&gt;255&lt;/red&gt;&lt;green&gt;255&lt;/green&gt;&lt;blue&gt;255&lt;/blue&gt;&lt;/color&gt;
  &lt;/inactive&gt;
&lt;/palette&gt;
</pre>
<p>See color for the format of the <tt>&lt;color&gt;</tt> element.</p>
<!-- eof -->
<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright &copy; 2001 
<a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt version 3.0.2</div>
</table></div></address></body>
</html>