Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > ac91357d6caede925de099a02fced14e > files > 2057

qt4-doc-4.2.1-1.el5_7.1.x86_64.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /tmp/qt-4.2.1-harald-1161357942206/qt-x11-opensource-src-4.2.1/doc/src/designer-manual.qdoc -->
<head>
  <title>Qt 4.2: Editing Resources with Qt Designer</title>
  <link rel="prev" href="designer-tab-order.html" />
  <link rel="contents" href="designer-manual.html" />
  <link rel="next" href="designer-customizing-forms.html" />
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td align="left" valign="top" width="32"><a href="http://www.trolltech.com/products/qt"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></a></td>
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
<td align="right" valign="top" width="230"><a href="http://www.trolltech.com"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></a></td></tr></table><p>
[Previous: <a href="designer-tab-order.html">Qt Designer's Tab Order Editing Mode</a>]
[<a href="designer-manual.html">Contents</a>]
[Next: <a href="designer-customizing-forms.html">Customizing Qt Designer Forms</a>]
</p>
<h1 align="center">Editing Resources with Qt Designer<br /><small></small></h1>
<p align="center"><img src="images/designer-resources-editing.png" /></p><p><i>Qt Designer</i> fully supports the <a href="resources.html">Qt Resource System</a>, allowing resources to be specified alongside forms as they are designed. To help designers and developers manage the resources that are needed by applications, <i>Qt Designer</i>'s resource editor allows resources to be defined on a per-form basis.</p>
<a name="defining-a-resource-file"></a>
<h2>Defining a Resource File</h2>
<p>To specify a resource file you must enable the resorce editor by opening the <b>Tools</b> menu, and switching on the <b>Resource Editor</b> option.</p>
<a name="resourcefiles"></a><p><table align="center" cellpadding="2" cellspacing="1" border="0">
<tr valign="top" class="odd"><td><img src="images/designer-resource-editor.png" /></td><td><b>Resource Files</b><p>Using the resource editor, you can either open existing resource files or create new ones. Click the <b>Current Resource</b> combobox to choose one or the other.</p>
</td></tr>
</table></p>
<p>Once a resource file is loaded, you can create or remove entries in the file using the provided <b>+</b> and <b>-</b> buttons, and specify resources (for example images) using the <b>Add Files</b> button. Note that these resources must reside within the current resource file's directory or one of its subdirectories.</p>
<a name="editresource"></a><p><table align="center" cellpadding="2" cellspacing="1" border="0">
<tr valign="top" class="odd"><td><img src="images/designer-edit-resource.png" /></td><td><b>Editing Resource Files</b><p>Press the <b>+</b> button to add a new resource entry to the file. Then use the <b>Add Files</b> button to specify the resource.</p>
<p>You can remove resources by selecting the corresponding entry in the resource editor, and press the <b>-</b> button.</p>
</td></tr>
</table></p>
<a name="using-the-resources"></a>
<h2>Using the Resources</h2>
<p>When the resources are defined you can use them actively when composing your form. For example, you might want to create a tool button using an icon specified in the resource file.</p>
<a name="usingresources"></a><p><table align="center" cellpadding="2" cellspacing="1" border="0">
<tr valign="top" class="odd"><td><img src="images/designer-resources-using.png" /></td><td><b>Using Resources</b><p>When changing properties which values might be defined within a resource file, <i>Qt Designer</i> presents a dialog that allows you to specify a resource in addition to the option of selecting a source file in the ordinary way.</p>
<p>You can open the resource editor to add new resources any time in the design process.</p>
</td></tr>
</table></p>
<p>
[Previous: <a href="designer-tab-order.html">Qt Designer's Tab Order Editing Mode</a>]
[<a href="designer-manual.html">Contents</a>]
[Next: <a href="designer-customizing-forms.html">Customizing Qt Designer Forms</a>]
</p>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2006 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt 4.2.1</div></td>
</tr></table></div></address></body>
</html>