<?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"> <!-- designer-manual.qdoc --> <head> <title>Qt 4.6: Editing Resources with Qt Designer</title> <link rel="prev" href="designer-creating-mainwindows.html" /> <link rel="contents" href="designer-manual.html" /> <link rel="next" href="designer-stylesheet.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://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td> <td width="1"> </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="functions.html"><font color="#004faf">All Functions</font></a> · <a href="overviews.html"><font color="#004faf">Overviews</font></a></td></tr></table><p> [Previous: <a href="designer-creating-mainwindows.html">Creating Main Windows in Qt Designer</a>] [<a href="designer-manual.html">Contents</a>] [Next: <a href="designer-stylesheet.html">Using Stylesheets with Qt Designer</a>] </p> <h1 class="title">Editing Resources with Qt Designer<br /><span class="subtitle"></span> </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>, enabling resources to be specified together with forms as they are designed. To aid designers and developers manage resources for their applications, <i>Qt Designer</i>'s resource editor allows resources to be defined on a per-form basis. In other words, each form can have a separate resource file.</p> <a name="defining-a-resource-file"></a> <h2>Defining a Resource File</h2> <p>To specify a resource file you must enable the resource editor by opening the <b>Tools</b> menu, and switching on the <b>Resource Browser</b> option.</p> <a name="resourcefiles"></a><p><table class="generic" align="center" cellpadding="2" cellspacing="1" border="0"> <tr valign="top" class="odd"><td><img src="images/designer-resource-browser.png" /></td><td><b>Resource Files</b><p>Within the resource browser, you can open existing resource files or create new ones. Click the <b>Edit Resources</b> button <img src="images/designer-edit-resources-button.png" /> to edit your resources. To reload resources, click on the <b>Reload</b> button <img src="images/designer-reload-resources-button.png" /> .</p> </td></tr> </table></p> <p>Once a resource file is loaded, you can create or remove entries in it using the given <b>Add Files</b> <img src="images/designer-add-resource-entry-button.png" /> and <b>Remove Files</b> <img src="images/designer-remove-resource-entry-button.png" /> buttons, and specify resources (e.g., images) using the <b>Add Files</b> button <img src="images/designer-add-files-button.png" /> . 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 class="generic" 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 <img src="images/designer-add-resource-entry-button.png" /> button to add a new resource entry to the file. Then use the <b>Add Files</b> button <img src="images/designer-add-files-button.png" /> to specify the resource.</p> <p>You can remove resources by selecting the corresponding entry in the resource editor, and pressing the <img src="images/designer-remove-resource-entry-button.png" /> button.</p> </td></tr> </table></p> <a name="using-the-resources"></a> <h2>Using the Resources</h2> <p>Once 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 class="generic" 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 with values that may be defined within a resource file, <i>Qt Designer</i>'s property editor allows you to specify a resource in addition to the option of selecting a source file in the ordinary way.</p> </td></tr> <tr valign="top" class="even"><td><img src="images/designer-resource-selector.png" /></td><td><b>Selecting a Resource</b><p>You can open the resource selector by clicking <b>Choose Resource...</b> to add resources any time during the design process.</p> </td></tr> </table></p> <p> [Previous: <a href="designer-creating-mainwindows.html">Creating Main Windows in Qt Designer</a>] [<a href="designer-manual.html">Contents</a>] [Next: <a href="designer-stylesheet.html">Using Stylesheets with Qt Designer</a>] </p> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td width="40%" align="left">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td> <td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td> <td width="40%" align="right"><div align="right">Qt 4.6.3</div></td> </tr></table></div></address></body> </html>