<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- qprintpreviewwidget.cpp --> <title>Qt 4.8: QPrintPreviewWidget Class Reference</title> <link rel="stylesheet" type="text/css" href="style/style.css" /> <script src="scripts/jquery.js" type="text/javascript"></script> <script src="scripts/functions.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="style/superfish.css" /> <link rel="stylesheet" type="text/css" href="style/narrow.css" /> <!--[if IE]> <meta name="MSSmartTagsPreventParsing" content="true"> <meta http-equiv="imagetoolbar" content="no"> <![endif]--> <!--[if lt IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie6.css"> <![endif]--> <!--[if IE 7]> <link rel="stylesheet" type="text/css" href="style/style_ie7.css"> <![endif]--> <!--[if IE 8]> <link rel="stylesheet" type="text/css" href="style/style_ie8.css"> <![endif]--> <script src="scripts/superfish.js" type="text/javascript"></script> <script src="scripts/narrow.js" type="text/javascript"></script> </head> <body class="" onload="CheckEmptyAndLoadList();"> <div class="header" id="qtdocheader"> <div class="content"> <div id="nav-logo"> <a href="index.html">Home</a></div> <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a> <div id="narrowsearch"></div> <div id="nav-topright"> <ul> <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li> <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li> <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/"> DOC</a></li> <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li> </ul> </div> <div id="shortCut"> <ul> <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li> <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS </a></li> </ul> </div> <ul class="sf-menu" id="narrowmenu"> <li><a href="#">API Lookup</a> <ul> <li><a href="classes.html">Class index</a></li> <li><a href="functions.html">Function index</a></li> <li><a href="modules.html">Modules</a></li> <li><a href="namespaces.html">Namespaces</a></li> <li><a href="qtglobal.html">Global Declarations</a></li> <li><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </li> <li><a href="#">Qt Topics</a> <ul> <li><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li><a href="supported-platforms.html">Supported Platforms</a></li> <li><a href="technology-apis.html">Qt and Key Technologies</a></li> <li><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </li> <li><a href="#">Examples</a> <ul> <li><a href="all-examples.html">Examples</a></li> <li><a href="tutorials.html">Tutorials</a></li> <li><a href="demos.html">Demos</a></li> <li><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </li> </ul> </div> </div> <div class="wrapper"> <div class="hd"> <span></span> </div> <div class="bd group"> <div class="sidebar"> <div class="searchlabel"> Search index:</div> <div class="search" id="sidebarsearch"> <form id="qtdocsearch" action="" onsubmit="return false;"> <fieldset> <input type="text" name="searchstring" id="pageType" value="" /> <div id="resultdialog"> <a href="#" id="resultclose">Close</a> <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span> results:</p> <ul id="resultlist" class="all"> </ul> </div> </fieldset> </form> </div> <div class="box first bottombar" id="lookup"> <h2 title="API Lookup"><span></span> API Lookup</h2> <div id="list001" class="list"> <ul id="ul001" > <li class="defaultLink"><a href="classes.html">Class index</a></li> <li class="defaultLink"><a href="functions.html">Function index</a></li> <li class="defaultLink"><a href="modules.html">Modules</a></li> <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li> <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li> <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li> </ul> </div> </div> <div class="box bottombar" id="topics"> <h2 title="Qt Topics"><span></span> Qt Topics</h2> <div id="list002" class="list"> <ul id="ul002" > <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> <li class="defaultLink"><a href="qtquick.html">Device UIs & Qt Quick</a></li> <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li> <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> </ul> </div> </div> <div class="box" id="examples"> <h2 title="Examples"><span></span> Examples</h2> <div id="list003" class="list"> <ul id="ul003"> <li class="defaultLink"><a href="all-examples.html">Examples</a></li> <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li> <li class="defaultLink"><a href="demos.html">Demos</a></li> <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li> </ul> </div> </div> </div> <div class="wrap"> <div class="toolbar"> <div class="breadcrumb toolblock"> <ul> <li class="first"><a href="index.html">Home</a></li> <!-- Breadcrumbs go here --> <li><a href="modules.html">Modules</a></li> <li><a href="qtgui.html">QtGui</a></li> <li>QPrintPreviewWidget</li> </ul> </div> <div class="toolbuttons toolblock"> <ul> <li id="smallA" class="t_button">A</li> <li id="medA" class="t_button active">A</li> <li id="bigA" class="t_button">A</li> <li id="print" class="t_button"><a href="javascript:this.print();"> <span>Print</span></a></li> </ul> </div> </div> <div class="content mainContent"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#public-types">Public Types</a></li> <li class="level1"><a href="#public-functions">Public Functions</a></li> <li class="level1"><a href="#public-slots">Public Slots</a></li> <li class="level1"><a href="#signals">Signals</a></li> <li class="level1"><a href="#details">Detailed Description</a></li> </ul> </div> <h1 class="title">QPrintPreviewWidget Class Reference</h1> <!-- $$$QPrintPreviewWidget-brief --> <p>The QPrintPreviewWidget class provides a widget for previewing page layouts for printer output. <a href="#details">More...</a></p> <!-- @@@QPrintPreviewWidget --> <pre class="cpp"> <span class="preprocessor">#include <QPrintPreviewWidget></span></pre><p><b>Inherits: </b><a href="qwidget.html">QWidget</a>.</p> <p>This class was introduced in Qt 4.4.</p> <ul> <li><a href="qprintpreviewwidget-members.html">List of all members, including inherited members</a></li> <li><a href="qprintpreviewwidget-qt3.html">Qt 3 support members</a></li> </ul> <a name="public-types"></a> <h2>Public Types</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#ViewMode-enum">ViewMode</a></b> { SinglePageView, FacingPagesView, AllPagesView }</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> enum </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#ZoomMode-enum">ZoomMode</a></b> { CustomZoom, FitToWidth, FitInView }</td></tr> </table> <a name="public-functions"></a> <h2>Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#QPrintPreviewWidget">QPrintPreviewWidget</a></b> ( QPrinter * <i>printer</i>, QWidget * <i>parent</i> = 0, Qt::WindowFlags <i>flags</i> = 0 )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#QPrintPreviewWidget-2">QPrintPreviewWidget</a></b> ( QWidget * <i>parent</i> = 0, Qt::WindowFlags <i>flags</i> = 0 )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#dtor.QPrintPreviewWidget">~QPrintPreviewWidget</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#currentPage">currentPage</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QPrinter::Orientation </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#orientation">orientation</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> int </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#pageCount">pageCount</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> ViewMode </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#viewMode">viewMode</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#zoomFactor">zoomFactor</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> ZoomMode </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#zoomMode">zoomMode</a></b> () const</td></tr> </table> <a name="reimplemented-public-functions"></a> <h2>Reimplemented Public Functions</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#setVisible">setVisible</a></b> ( bool <i>visible</i> )</td></tr> </table> <ul> <li class="fn">221 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li> <li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li> <li class="fn">13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li> </ul> <a name="public-slots"></a> <h2>Public Slots</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#fitInView">fitInView</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#fitToWidth">fitToWidth</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#print">print</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#setAllPagesViewMode">setAllPagesViewMode</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#setCurrentPage">setCurrentPage</a></b> ( int <i>page</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#setFacingPagesViewMode">setFacingPagesViewMode</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#setLandscapeOrientation">setLandscapeOrientation</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#setOrientation">setOrientation</a></b> ( QPrinter::Orientation <i>orientation</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#setPortraitOrientation">setPortraitOrientation</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#setSinglePageViewMode">setSinglePageViewMode</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#setViewMode">setViewMode</a></b> ( ViewMode <i>mode</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#setZoomFactor">setZoomFactor</a></b> ( qreal <i>factor</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#setZoomMode">setZoomMode</a></b> ( ZoomMode <i>zoomMode</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#updatePreview">updatePreview</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#zoomIn">zoomIn</a></b> ( qreal <i>factor</i> = 1.1 )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#zoomOut">zoomOut</a></b> ( qreal <i>factor</i> = 1.1 )</td></tr> </table> <ul> <li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li> <li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li> </ul> <a name="signals"></a> <h2>Signals</h2> <table class="alignedsummary"> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#paintRequested">paintRequested</a></b> ( QPrinter * <i>printer</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qprintpreviewwidget.html#previewChanged">previewChanged</a></b> ()</td></tr> </table> <ul> <li class="fn">1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li> <li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li class="fn">58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li> <li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li> <li class="fn">4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li> <li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li> <li class="fn">37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li> <li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li> <li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li> <li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li> </ul> <a name="details"></a> <!-- $$$QPrintPreviewWidget-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The QPrintPreviewWidget class provides a widget for previewing page layouts for printer output.</p> <p><a href="qprintpreviewdialog.html">QPrintPreviewDialog</a> uses a QPrintPreviewWidget internally, and the purpose of QPrintPreviewWidget is to make it possible to embed the preview into other widgets. It also makes it possible to build a different user interface around it than the default one provided with <a href="qprintpreviewdialog.html">QPrintPreviewDialog</a>.</p> <p>Using QPrintPreviewWidget is straightforward:</p> <ol class="1"> <li>Create the QPrintPreviewWidget<p>Construct the QPrintPreviewWidget either by passing in an existing <a href="qprinter.html">QPrinter</a> object, or have QPrintPreviewWidget create a default constructed <a href="qprinter.html">QPrinter</a> object for you.</p> </li> <li>Connect the <a href="qprintpreviewwidget.html#paintRequested">paintRequested</a>() signal to a slot.<p>When the widget needs to generate a set of preview pages, a <a href="qprintpreviewwidget.html#paintRequested">paintRequested</a>() signal will be emitted from the widget. Connect a slot to this signal, and draw onto the <a href="qprinter.html">QPrinter</a> passed in as a signal parameter. Call <a href="qprinter.html#newPage">QPrinter::newPage</a>(), to start a new page in the preview.</p> </li> </ol> </div> <p><b>See also </b><a href="qprinter.html">QPrinter</a>, <a href="qprintdialog.html">QPrintDialog</a>, <a href="qpagesetupdialog.html">QPageSetupDialog</a>, and <a href="qprintpreviewdialog.html">QPrintPreviewDialog</a>.</p> <!-- @@@QPrintPreviewWidget --> <div class="types"> <h2>Member Type Documentation</h2> <!-- $$$ViewMode$$$SinglePageView$$$FacingPagesView$$$AllPagesView --> <h3 class="fn"><a name="ViewMode-enum"></a>enum QPrintPreviewWidget::<span class="name">ViewMode</span></h3> <p>This enum is used to describe the view mode of the preview widget.</p> <table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr> <tr><td class="topAlign"><tt>QPrintPreviewWidget::SinglePageView</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">A mode where single pages in the preview is viewed.</td></tr> <tr><td class="topAlign"><tt>QPrintPreviewWidget::FacingPagesView</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">A mode where the facing pages in the preview is viewed.</td></tr> <tr><td class="topAlign"><tt>QPrintPreviewWidget::AllPagesView</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">A view mode where all the pages in the preview is viewed.</td></tr> </table> <!-- @@@ViewMode --> <!-- $$$ZoomMode$$$CustomZoom$$$FitToWidth$$$FitInView --> <h3 class="fn"><a name="ZoomMode-enum"></a>enum QPrintPreviewWidget::<span class="name">ZoomMode</span></h3> <p>This enum is used to describe zoom mode of the preview widget.</p> <table class="valuelist"><tr valign="top" class="odd"><th class="tblConst">Constant</th><th class="tblval">Value</th><th class="tbldscr">Description</th></tr> <tr><td class="topAlign"><tt>QPrintPreviewWidget::CustomZoom</tt></td><td class="topAlign"><tt>0</tt></td><td class="topAlign">The zoom is set to a custom zoom value.</td></tr> <tr><td class="topAlign"><tt>QPrintPreviewWidget::FitToWidth</tt></td><td class="topAlign"><tt>1</tt></td><td class="topAlign">This mode fits the current page to the width of the view.</td></tr> <tr><td class="topAlign"><tt>QPrintPreviewWidget::FitInView</tt></td><td class="topAlign"><tt>2</tt></td><td class="topAlign">This mode fits the current page inside the view.</td></tr> </table> <!-- @@@ZoomMode --> </div> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QPrintPreviewWidget[overload1]$$$QPrintPreviewWidgetQPrinter*QWidget*Qt::WindowFlags --> <h3 class="fn"><a name="QPrintPreviewWidget"></a>QPrintPreviewWidget::<span class="name">QPrintPreviewWidget</span> ( <span class="type"><a href="qprinter.html">QPrinter</a></span> * <i>printer</i>, <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> = 0, <span class="type"><a href="qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>flags</i> = 0 )</h3> <p>Constructs a <a href="qprintpreviewwidget.html">QPrintPreviewWidget</a> based on <i>printer</i> and with <i>parent</i> as the parent widget. The widget flags <i>flags</i> are passed on to the <a href="qwidget.html">QWidget</a> constructor.</p> <p><b>See also </b><a href="qwidget.html#windowFlags-prop">QWidget::setWindowFlags</a>().</p> <!-- @@@QPrintPreviewWidget --> <!-- $$$QPrintPreviewWidget$$$QPrintPreviewWidgetQWidget*Qt::WindowFlags --> <h3 class="fn"><a name="QPrintPreviewWidget-2"></a>QPrintPreviewWidget::<span class="name">QPrintPreviewWidget</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> = 0, <span class="type"><a href="qt.html#WindowType-enum">Qt::WindowFlags</a></span> <i>flags</i> = 0 )</h3> <p>This is an overloaded function.</p> <p>This will cause <a href="qprintpreviewwidget.html">QPrintPreviewWidget</a> to create an internal, default constructed <a href="qprinter.html">QPrinter</a> object, which will be used to generate the preview.</p> <!-- @@@QPrintPreviewWidget --> <!-- $$$~QPrintPreviewWidget[overload1]$$$~QPrintPreviewWidget --> <h3 class="fn"><a name="dtor.QPrintPreviewWidget"></a>QPrintPreviewWidget::<span class="name">~QPrintPreviewWidget</span> ()</h3> <p>Destroys the <a href="qprintpreviewwidget.html">QPrintPreviewWidget</a>.</p> <!-- @@@~QPrintPreviewWidget --> <!-- $$$currentPage[overload1]$$$currentPage --> <h3 class="fn"><a name="currentPage"></a><span class="type">int</span> QPrintPreviewWidget::<span class="name">currentPage</span> () const</h3> <p>Returns the currently viewed page in the preview.</p> <p><b>See also </b><a href="qprintpreviewwidget.html#setCurrentPage">setCurrentPage</a>().</p> <!-- @@@currentPage --> <!-- $$$fitInView[overload1]$$$fitInView --> <h3 class="fn"><a name="fitInView"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">fitInView</span> ()<tt> [slot]</tt></h3> <p>This is a convenience function and is the same as calling <tt>setZoomMode(QPrintPreviewWidget::FitInView)</tt>.</p> <!-- @@@fitInView --> <!-- $$$fitToWidth[overload1]$$$fitToWidth --> <h3 class="fn"><a name="fitToWidth"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">fitToWidth</span> ()<tt> [slot]</tt></h3> <p>This is a convenience function and is the same as calling <tt>setZoomMode(QPrintPreviewWidget::FitToWidth)</tt>.</p> <!-- @@@fitToWidth --> <!-- $$$orientation[overload1]$$$orientation --> <h3 class="fn"><a name="orientation"></a><span class="type"><a href="qprinter.html#Orientation-enum">QPrinter::Orientation</a></span> QPrintPreviewWidget::<span class="name">orientation</span> () const</h3> <p>Returns the current orientation of the preview. This value is obtained from the <a href="qprinter.html">QPrinter</a> object associated with the preview.</p> <p><b>See also </b><a href="qprintpreviewwidget.html#setOrientation">setOrientation</a>().</p> <!-- @@@orientation --> <!-- $$$pageCount[overload1]$$$pageCount --> <h3 class="fn"><a name="pageCount"></a><span class="type">int</span> QPrintPreviewWidget::<span class="name">pageCount</span> () const</h3> <p>Returns the number of pages in the preview.</p> <p>This function was introduced in Qt 4.6.</p> <!-- @@@pageCount --> <!-- $$$paintRequested[overload1]$$$paintRequestedQPrinter* --> <h3 class="fn"><a name="paintRequested"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">paintRequested</span> ( <span class="type"><a href="qprinter.html">QPrinter</a></span> * <i>printer</i> )<tt> [signal]</tt></h3> <p>This signal is emitted when the preview widget needs to generate a set of preview pages. <i>printer</i> is the printer associated with this preview widget.</p> <!-- @@@paintRequested --> <!-- $$$previewChanged[overload1]$$$previewChanged --> <h3 class="fn"><a name="previewChanged"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">previewChanged</span> ()<tt> [signal]</tt></h3> <p>This signal is emitted whenever the preview widget has changed some internal state, such as the orientation.</p> <!-- @@@previewChanged --> <!-- $$$print[overload1]$$$print --> <h3 class="fn"><a name="print"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">print</span> ()<tt> [slot]</tt></h3> <p>Prints the preview to the printer associated with the preview.</p> <!-- @@@print --> <!-- $$$setAllPagesViewMode[overload1]$$$setAllPagesViewMode --> <h3 class="fn"><a name="setAllPagesViewMode"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">setAllPagesViewMode</span> ()<tt> [slot]</tt></h3> <p>This is a convenience function and is the same as calling <tt>setViewMode(QPrintPreviewWidget::AllPagesView)</tt>.</p> <!-- @@@setAllPagesViewMode --> <!-- $$$setCurrentPage[overload1]$$$setCurrentPageint --> <h3 class="fn"><a name="setCurrentPage"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">setCurrentPage</span> ( <span class="type">int</span> <i>page</i> )<tt> [slot]</tt></h3> <p>Sets the current page in the preview. This will cause the view to skip to the beginning of <i>page</i>.</p> <p><b>See also </b><a href="qprintpreviewwidget.html#currentPage">currentPage</a>().</p> <!-- @@@setCurrentPage --> <!-- $$$setFacingPagesViewMode[overload1]$$$setFacingPagesViewMode --> <h3 class="fn"><a name="setFacingPagesViewMode"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">setFacingPagesViewMode</span> ()<tt> [slot]</tt></h3> <p>This is a convenience function and is the same as calling <tt>setViewMode(QPrintPreviewWidget::FacingPagesView)</tt>.</p> <!-- @@@setFacingPagesViewMode --> <!-- $$$setLandscapeOrientation[overload1]$$$setLandscapeOrientation --> <h3 class="fn"><a name="setLandscapeOrientation"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">setLandscapeOrientation</span> ()<tt> [slot]</tt></h3> <p>This is a convenience function and is the same as calling <tt>setOrientation(QPrinter::Landscape)</tt>.</p> <!-- @@@setLandscapeOrientation --> <!-- $$$setOrientation[overload1]$$$setOrientationQPrinter::Orientation --> <h3 class="fn"><a name="setOrientation"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">setOrientation</span> ( <span class="type"><a href="qprinter.html#Orientation-enum">QPrinter::Orientation</a></span> <i>orientation</i> )<tt> [slot]</tt></h3> <p>Sets the current orientation to <i>orientation</i>. This value will be set on the <a href="qprinter.html">QPrinter</a> object associated with the preview.</p> <p><b>See also </b><a href="qprintpreviewwidget.html#orientation">orientation</a>().</p> <!-- @@@setOrientation --> <!-- $$$setPortraitOrientation[overload1]$$$setPortraitOrientation --> <h3 class="fn"><a name="setPortraitOrientation"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">setPortraitOrientation</span> ()<tt> [slot]</tt></h3> <p>This is a convenience function and is the same as calling <tt>setOrientation(QPrinter::Portrait)</tt>.</p> <!-- @@@setPortraitOrientation --> <!-- $$$setSinglePageViewMode[overload1]$$$setSinglePageViewMode --> <h3 class="fn"><a name="setSinglePageViewMode"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">setSinglePageViewMode</span> ()<tt> [slot]</tt></h3> <p>This is a convenience function and is the same as calling <tt>setViewMode(QPrintPreviewWidget::SinglePageView)</tt>.</p> <!-- @@@setSinglePageViewMode --> <!-- $$$setViewMode[overload1]$$$setViewModeViewMode --> <h3 class="fn"><a name="setViewMode"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">setViewMode</span> ( <span class="type"><a href="qprintpreviewwidget.html#ViewMode-enum">ViewMode</a></span> <i>mode</i> )<tt> [slot]</tt></h3> <p>Sets the view mode to <i>mode</i>. The default view mode is <a href="qprintpreviewwidget.html#ViewMode-enum">SinglePageView</a>.</p> <p><b>See also </b><a href="qprintpreviewwidget.html#viewMode">viewMode</a>().</p> <!-- @@@setViewMode --> <!-- $$$setVisible[overload1]$$$setVisiblebool --> <h3 class="fn"><a name="setVisible"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">setVisible</span> ( <span class="type">bool</span> <i>visible</i> )<tt> [virtual]</tt></h3> <p>Reimplemented from <a href="qwidget.html#visible-prop">QWidget::setVisible</a>().</p> <!-- @@@setVisible --> <!-- $$$setZoomFactor[overload1]$$$setZoomFactorqreal --> <h3 class="fn"><a name="setZoomFactor"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">setZoomFactor</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>factor</i> )<tt> [slot]</tt></h3> <p>Sets the zoom factor of the view to <i>factor</i>. For example, a value of 1.0 indicates an unscaled view, which is approximately the size the view will have on paper. A value of 0.5 will halve the size of the view, while a value of 2.0 will double the size of the view.</p> <p><b>See also </b><a href="qprintpreviewwidget.html#zoomFactor">zoomFactor</a>().</p> <!-- @@@setZoomFactor --> <!-- $$$setZoomMode[overload1]$$$setZoomModeZoomMode --> <h3 class="fn"><a name="setZoomMode"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">setZoomMode</span> ( <span class="type"><a href="qprintpreviewwidget.html#ZoomMode-enum">ZoomMode</a></span> <i>zoomMode</i> )<tt> [slot]</tt></h3> <p>Sets the zoom mode to <i>zoomMode</i>. The default zoom mode is <a href="qprintpreviewwidget.html#ZoomMode-enum">FitInView</a>.</p> <p><b>See also </b><a href="qprintpreviewwidget.html#zoomMode">zoomMode</a>(), <a href="qprintpreviewwidget.html#viewMode">viewMode</a>(), and <a href="qprintpreviewwidget.html#setViewMode">setViewMode</a>().</p> <!-- @@@setZoomMode --> <!-- $$$updatePreview[overload1]$$$updatePreview --> <h3 class="fn"><a name="updatePreview"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">updatePreview</span> ()<tt> [slot]</tt></h3> <p>This function updates the preview, which causes the <a href="qprintpreviewwidget.html#paintRequested">paintRequested</a>() signal to be emitted.</p> <!-- @@@updatePreview --> <!-- $$$viewMode[overload1]$$$viewMode --> <h3 class="fn"><a name="viewMode"></a><span class="type"><a href="qprintpreviewwidget.html#ViewMode-enum">ViewMode</a></span> QPrintPreviewWidget::<span class="name">viewMode</span> () const</h3> <p>Returns the current view mode. The default view mode is <a href="qprintpreviewwidget.html#ViewMode-enum">SinglePageView</a>.</p> <p><b>See also </b><a href="qprintpreviewwidget.html#setViewMode">setViewMode</a>().</p> <!-- @@@viewMode --> <!-- $$$zoomFactor[overload1]$$$zoomFactor --> <h3 class="fn"><a name="zoomFactor"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QPrintPreviewWidget::<span class="name">zoomFactor</span> () const</h3> <p>Returns the zoom factor of the view.</p> <p><b>See also </b><a href="qprintpreviewwidget.html#setZoomFactor">setZoomFactor</a>().</p> <!-- @@@zoomFactor --> <!-- $$$zoomIn[overload1]$$$zoomInqreal --> <h3 class="fn"><a name="zoomIn"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">zoomIn</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>factor</i> = 1.1 )<tt> [slot]</tt></h3> <p>Zooms the current view in by <i>factor</i>. The default value for <i>factor</i> is 1.1, which means the view will be scaled up by 10%.</p> <!-- @@@zoomIn --> <!-- $$$zoomMode[overload1]$$$zoomMode --> <h3 class="fn"><a name="zoomMode"></a><span class="type"><a href="qprintpreviewwidget.html#ZoomMode-enum">ZoomMode</a></span> QPrintPreviewWidget::<span class="name">zoomMode</span> () const</h3> <p>Returns the current zoom mode.</p> <p><b>See also </b><a href="qprintpreviewwidget.html#setZoomMode">setZoomMode</a>(), <a href="qprintpreviewwidget.html#viewMode">viewMode</a>(), and <a href="qprintpreviewwidget.html#setViewMode">setViewMode</a>().</p> <!-- @@@zoomMode --> <!-- $$$zoomOut[overload1]$$$zoomOutqreal --> <h3 class="fn"><a name="zoomOut"></a><span class="type">void</span> QPrintPreviewWidget::<span class="name">zoomOut</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>factor</i> = 1.1 )<tt> [slot]</tt></h3> <p>Zooms the current view out by <i>factor</i>. The default value for <i>factor</i> is 1.1, which means the view will be scaled down by 10%.</p> <!-- @@@zoomOut --> </div> </div> </div> </div> <div class="ft"> <span></span> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2015 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.</p> <br /> <p> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.</p> <p> Documentation sources may be obtained from <a href="http://www.qt-project.org"> www.qt-project.org</a>.</p> <br /> <p> Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. <a title="Privacy Policy" href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p> </div> <script src="scripts/functions.js" type="text/javascript"></script> </body> </html>