<?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: Saving, Previewing and Printing Forms in Qt Designer</title> <link rel="prev" href="designer-layouts.html" /> <link rel="contents" href="designer-manual.html" /> <link rel="next" href="designer-buddy-mode.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-layouts.html">Using Layouts in Qt Designer</a>] [<a href="designer-manual.html">Contents</a>] [Next: <a href="designer-buddy-mode.html">Qt Designer's Buddy Editing Mode</a>] </p> <h1 class="title">Saving, Previewing and Printing Forms in Qt Designer<br /><span class="subtitle"></span> </h1> <p>Although <i>Qt Designer</i>'s forms are accurate representations of the components being edited, it is useful to preview the final appearance while editing. This feature can be activated by opening the <b>Form</b> menu and selecting <b>Preview</b>, or by pressing <b>Ctrl+R</b> when in the form.</p> <p align="center"><img src="images/designer-dialog-preview.png" /></p><p>The preview shows exactly what the final component will look like when used in an application.</p> <p>Since Qt 4.4, it is possible to preview forms with various skins - default skins, skins created with Qt Style Sheets or device skins. This feature simulates the effect of calling <tt>QApplication::setStyleSheet()</tt> in the application.</p> <p>To preview your form with skins, open the <b>Edit</b> menu and select <b>Preferences...</b></p> <p>You will see the dialog shown below:</p> <p align="center"><img src="images/designer-preview-style.png" /></p><p>The <b>Print/Preview Configuration</b> checkbox must be checked to activate previews of skins. You can select the styles provided from the <b>Style</b> drop-down box.</p> <p align="center"><img src="images/designer-preview-style-selection.png" /></p><p>Alternatively, you can preview custom style sheet created with Qt Style Sheets. The figure below shows an example of Qt Style Sheet syntax and the corresponding output.</p> <p align="center"><img src="images/designer-preview-stylesheet.png" /></p><p>Another option would be to preview your form with device skins. A list of generic device skins are available in <i>Qt Designer</i>, however, you may also use other QVFB skins with the <b>Browse...</b> option.</p> <p align="center"><img src="images/designer-preview-deviceskin-selection.png" /></p><a name="viewing-the-form-s-code"></a> <h2>Viewing the Form's Code</h2> <p>Since Qt 4.4, it is possible to view code generated by the User Interface Compiler (uic) for the <i>Qt Designer</i> form.</p> <p align="center"><img src="images/designer-form-viewcode.png" /></p><p>Select <b>View Code...</b> from the <b>Form</b> menu and a dialog with the generated code will be displayed. The screenshot below is an example of code generated by the <tt>uic</tt>.</p> <p align="center"><img src="images/designer-code-viewer.png" /></p><a name="saving-and-printing-the-form"></a> <h2>Saving and Printing the Form</h2> <p>Forms created in <i>Qt Designer</i> can be saved to an image or printed.</p> <p><table class="generic" align="center" cellpadding="2" cellspacing="1" border="0"> <tr valign="top" class="odd"><td><img src="images/designer-file-menu.png" /></td><td><b>Saving Forms</b><p>To save a form as an image, choose the <b>Save Image...</b> option. The file will be saved in <tt>.png</tt> format.</p> <p><b>Printing Forms</b></p> <p>To print a form, select the <b>Print...</b> option.</p> </td></tr> </table></p> <p> [Previous: <a href="designer-layouts.html">Using Layouts in Qt Designer</a>] [<a href="designer-manual.html">Contents</a>] [Next: <a href="designer-buddy-mode.html">Qt Designer's Buddy Editing Mode</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>