Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 1dd17e0d683ef79b4bb6872bbf359d7f > files > 6359

qt4-doc-4.8.7-26.2.mga7.noarch.rpm

<?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" />
<!-- qsize.cpp -->
  <title>Qt 4.8: QSizeF 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 &amp; 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>&nbsp;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 &amp; 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="qtcore.html">QtCore</a></li>
<li>QSizeF</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-functions">Public Functions</a></li>
<li class="level1"><a href="#related-non-members">Related Non-Members</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
</ul>
</div>
<h1 class="title">QSizeF Class Reference</h1>
<!-- $$$QSizeF-brief -->
<p>The QSizeF class defines the size of a two-dimensional object using floating point precision. <a href="#details">More...</a></p>
<!-- @@@QSizeF -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QSizeF&gt;</span></pre><ul>
<li><a href="qsizef-members.html">List of all members, including inherited members</a></li>
</ul>
<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="qsizef.html#QSizeF">QSizeF</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#QSizeF-2">QSizeF</a></b> ( const QSize &amp; <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#QSizeF-3">QSizeF</a></b> ( qreal <i>width</i>, qreal <i>height</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSizeF </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#boundedTo">boundedTo</a></b> ( const QSizeF &amp; <i>otherSize</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSizeF </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#expandedTo">expandedTo</a></b> ( const QSizeF &amp; <i>otherSize</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#height">height</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#isEmpty">isEmpty</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#isNull">isNull</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#isValid">isValid</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal &amp; </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#rheight">rheight</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal &amp; </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#rwidth">rwidth</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#scale">scale</a></b> ( qreal <i>width</i>, qreal <i>height</i>, Qt::AspectRatioMode <i>mode</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#scale-2">scale</a></b> ( const QSizeF &amp; <i>size</i>, Qt::AspectRatioMode <i>mode</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#setHeight">setHeight</a></b> ( qreal <i>height</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#setWidth">setWidth</a></b> ( qreal <i>width</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSize </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#toSize">toSize</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#transpose">transpose</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#width">width</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSizeF &amp; </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#operator-2a-eq">operator*=</a></b> ( qreal <i>factor</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSizeF &amp; </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#operator-2b-eq">operator+=</a></b> ( const QSizeF &amp; <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSizeF &amp; </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#operator--eq">operator-=</a></b> ( const QSizeF &amp; <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QSizeF &amp; </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#operator-2f-eq">operator/=</a></b> ( qreal <i>divisor</i> )</td></tr>
</table>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#operator-not-eq-23">operator!=</a></b> ( const QSizeF &amp; <i>s1</i>, const QSizeF &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QSizeF </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#operator-2a-59">operator*</a></b> ( const QSizeF &amp; <i>size</i>, qreal <i>factor</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QSizeF </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#operator-2a-60">operator*</a></b> ( qreal <i>factor</i>, const QSizeF &amp; <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QSizeF </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#operator-2b-13">operator+</a></b> ( const QSizeF &amp; <i>s1</i>, const QSizeF &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QSizeF </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#operator--4">operator-</a></b> ( const QSizeF &amp; <i>s1</i>, const QSizeF &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> const QSizeF </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#operator-2f-12">operator/</a></b> ( const QSizeF &amp; <i>size</i>, qreal <i>divisor</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#operator-lt-lt-32">operator&lt;&lt;</a></b> ( QDataStream &amp; <i>stream</i>, const QSizeF &amp; <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#operator-eq-eq-22">operator==</a></b> ( const QSizeF &amp; <i>s1</i>, const QSizeF &amp; <i>s2</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qsizef.html#operator-gt-gt-20">operator&gt;&gt;</a></b> ( QDataStream &amp; <i>stream</i>, QSizeF &amp; <i>size</i> )</td></tr>
</table>
<a name="details"></a>
<!-- $$$QSizeF-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QSizeF class defines the size of a two-dimensional object using floating point precision.</p>
<p>A size is specified by a <a href="qsizef.html#width">width</a>() and a <a href="qsizef.html#height">height</a>(). It can be set in the constructor and changed using the <a href="qsizef.html#setWidth">setWidth</a>(), <a href="qsizef.html#setHeight">setHeight</a>(), or <a href="qsizef.html#scale">scale</a>() functions, or using arithmetic operators. A size can also be manipulated directly by retrieving references to the width and height using the <a href="qsizef.html#rwidth">rwidth</a>() and <a href="qsizef.html#rheight">rheight</a>() functions. Finally, the width and height can be swapped using the <a href="qsizef.html#transpose">transpose</a>() function.</p>
<p>The <a href="qsizef.html#isValid">isValid</a>() function determines if a size is valid. A valid size has both width and height greater than or equal to zero. The <a href="qsizef.html#isEmpty">isEmpty</a>() function returns true if either of the width and height is <i>less</i> than (or equal to) zero, while the <a href="qsizef.html#isNull">isNull</a>() function returns true only if both the width and the height is zero.</p>
<p>Use the <a href="qsizef.html#expandedTo">expandedTo</a>() function to retrieve a size which holds the maximum height and width of this size and a given size. Similarly, the <a href="qsizef.html#boundedTo">boundedTo</a>() function returns a size which holds the minimum height and width of this size and a given size.</p>
<p>The QSizeF class also provides the <a href="qsizef.html#toSize">toSize</a>() function returning a <a href="qsize.html">QSize</a> copy of this size, constructed by rounding the width and height to the nearest integers.</p>
<p>QSizeF objects can be streamed as well as compared.</p>
</div>
<p><b>See also </b><a href="qsize.html">QSize</a>, <a href="qpointf.html">QPointF</a>, and <a href="qrectf.html">QRectF</a>.</p>
<!-- @@@QSizeF -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QSizeF[overload1]$$$QSizeF -->
<h3 class="fn"><a name="QSizeF"></a>QSizeF::<span class="name">QSizeF</span> ()</h3>
<p>Constructs an invalid size.</p>
<p><b>See also </b><a href="qsizef.html#isValid">isValid</a>().</p>
<!-- @@@QSizeF -->
<!-- $$$QSizeF$$$QSizeFconstQSize& -->
<h3 class="fn"><a name="QSizeF-2"></a>QSizeF::<span class="name">QSizeF</span> ( const <span class="type"><a href="qsize.html">QSize</a></span> &amp; <i>size</i> )</h3>
<p>Constructs a size with floating point accuracy from the given <i>size</i>.</p>
<p><b>See also </b><a href="qsizef.html#toSize">toSize</a>().</p>
<!-- @@@QSizeF -->
<!-- $$$QSizeF$$$QSizeFqrealqreal -->
<h3 class="fn"><a name="QSizeF-3"></a>QSizeF::<span class="name">QSizeF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>width</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>height</i> )</h3>
<p>Constructs a size with the given <i>width</i> and <i>height</i>.</p>
<!-- @@@QSizeF -->
<!-- $$$boundedTo[overload1]$$$boundedToconstQSizeF& -->
<h3 class="fn"><a name="boundedTo"></a><span class="type">QSizeF</span> QSizeF::<span class="name">boundedTo</span> ( const <span class="type">QSizeF</span> &amp; <i>otherSize</i> ) const</h3>
<p>Returns a size holding the minimum width and height of this size and the given <i>otherSize</i>.</p>
<p><b>See also </b><a href="qsizef.html#expandedTo">expandedTo</a>() and <a href="qsizef.html#scale">scale</a>().</p>
<!-- @@@boundedTo -->
<!-- $$$expandedTo[overload1]$$$expandedToconstQSizeF& -->
<h3 class="fn"><a name="expandedTo"></a><span class="type">QSizeF</span> QSizeF::<span class="name">expandedTo</span> ( const <span class="type">QSizeF</span> &amp; <i>otherSize</i> ) const</h3>
<p>Returns a size holding the maximum width and height of this size and the given <i>otherSize</i>.</p>
<p><b>See also </b><a href="qsizef.html#boundedTo">boundedTo</a>() and <a href="qsizef.html#scale">scale</a>().</p>
<!-- @@@expandedTo -->
<!-- $$$height[overload1]$$$height -->
<h3 class="fn"><a name="height"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QSizeF::<span class="name">height</span> () const</h3>
<p>Returns the height.</p>
<p><b>See also </b><a href="qsizef.html#width">width</a>() and <a href="qsizef.html#setHeight">setHeight</a>().</p>
<!-- @@@height -->
<!-- $$$isEmpty[overload1]$$$isEmpty -->
<h3 class="fn"><a name="isEmpty"></a><span class="type">bool</span> QSizeF::<span class="name">isEmpty</span> () const</h3>
<p>Returns true if either of the width and height is less than or equal to 0; otherwise returns false.</p>
<p><b>See also </b><a href="qsizef.html#isNull">isNull</a>() and <a href="qsizef.html#isValid">isValid</a>().</p>
<!-- @@@isEmpty -->
<!-- $$$isNull[overload1]$$$isNull -->
<h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QSizeF::<span class="name">isNull</span> () const</h3>
<p>Returns true if both the width and height are +0.0; otherwise returns false.</p>
<p><b>Note:</b> Since this function treats +0.0 and -0.0 differently, sizes with zero width and height where either or both values have a negative sign are not defined to be null sizes.</p>
<p><b>See also </b><a href="qsizef.html#isValid">isValid</a>() and <a href="qsizef.html#isEmpty">isEmpty</a>().</p>
<!-- @@@isNull -->
<!-- $$$isValid[overload1]$$$isValid -->
<h3 class="fn"><a name="isValid"></a><span class="type">bool</span> QSizeF::<span class="name">isValid</span> () const</h3>
<p>Returns true if both the width and height is equal to or greater than 0; otherwise returns false.</p>
<p><b>See also </b><a href="qsizef.html#isNull">isNull</a>() and <a href="qsizef.html#isEmpty">isEmpty</a>().</p>
<!-- @@@isValid -->
<!-- $$$rheight[overload1]$$$rheight -->
<h3 class="fn"><a name="rheight"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> &amp; QSizeF::<span class="name">rheight</span> ()</h3>
<p>Returns a reference to the height.</p>
<p>Using a reference makes it possible to manipulate the height directly. For example:</p>
<pre class="cpp"> <span class="type"><a href="qsizef.html">QSizeF</a></span> size(<span class="number">100</span><span class="operator">,</span> <span class="number">10.2</span>);
 size<span class="operator">.</span>rheight() <span class="operator">+</span><span class="operator">=</span> <span class="number">5.5</span>;

 <span class="comment">// size becomes (100,15.7)</span></pre>
<p><b>See also </b><a href="qsizef.html#rwidth">rwidth</a>() and <a href="qsizef.html#setHeight">setHeight</a>().</p>
<!-- @@@rheight -->
<!-- $$$rwidth[overload1]$$$rwidth -->
<h3 class="fn"><a name="rwidth"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> &amp; QSizeF::<span class="name">rwidth</span> ()</h3>
<p>Returns a reference to the width.</p>
<p>Using a reference makes it possible to manipulate the width directly. For example:</p>
<pre class="cpp"> <span class="type"><a href="qsizef.html">QSizeF</a></span> size(<span class="number">100.3</span><span class="operator">,</span> <span class="number">10</span>);
 size<span class="operator">.</span>rwidth() <span class="operator">+</span><span class="operator">=</span> <span class="number">20.5</span>;

  <span class="comment">// size becomes (120.8,10)</span></pre>
<p><b>See also </b><a href="qsizef.html#rheight">rheight</a>() and <a href="qsizef.html#setWidth">setWidth</a>().</p>
<!-- @@@rwidth -->
<!-- $$$scale[overload1]$$$scaleqrealqrealQt::AspectRatioMode -->
<h3 class="fn"><a name="scale"></a><span class="type">void</span> QSizeF::<span class="name">scale</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>width</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>height</i>, <span class="type"><a href="qt.html#AspectRatioMode-enum">Qt::AspectRatioMode</a></span> <i>mode</i> )</h3>
<p>Scales the size to a rectangle with the given <i>width</i> and <i>height</i>, according to the specified <i>mode</i>.</p>
<ul>
<li>If <i>mode</i> is <a href="qt.html#AspectRatioMode-enum">Qt::IgnoreAspectRatio</a>, the size is set to (<i>width</i>, <i>height</i>).</li>
<li>If <i>mode</i> is <a href="qt.html#AspectRatioMode-enum">Qt::KeepAspectRatio</a>, the current size is scaled to a rectangle as large as possible inside (<i>width</i>, <i>height</i>), preserving the aspect ratio.</li>
<li>If <i>mode</i> is <a href="qt.html#AspectRatioMode-enum">Qt::KeepAspectRatioByExpanding</a>, the current size is scaled to a rectangle as small as possible outside (<i>width</i>, <i>height</i>), preserving the aspect ratio.</li>
</ul>
<p>Example:</p>
<pre class="cpp"> <span class="type"><a href="qsizef.html">QSizeF</a></span> t1(<span class="number">10</span><span class="operator">,</span> <span class="number">12</span>);
 t1<span class="operator">.</span>scale(<span class="number">60</span><span class="operator">,</span> <span class="number">60</span><span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>IgnoreAspectRatio);
 <span class="comment">// t1 is (60, 60)</span>

 <span class="type"><a href="qsizef.html">QSizeF</a></span> t2(<span class="number">10</span><span class="operator">,</span> <span class="number">12</span>);
 t2<span class="operator">.</span>scale(<span class="number">60</span><span class="operator">,</span> <span class="number">60</span><span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>KeepAspectRatio);
 <span class="comment">// t2 is (50, 60)</span>

 <span class="type"><a href="qsizef.html">QSizeF</a></span> t3(<span class="number">10</span><span class="operator">,</span> <span class="number">12</span>);
 t3<span class="operator">.</span>scale(<span class="number">60</span><span class="operator">,</span> <span class="number">60</span><span class="operator">,</span> <span class="type"><a href="qt.html">Qt</a></span><span class="operator">::</span>KeepAspectRatioByExpanding);
 <span class="comment">// t3 is (60, 72)</span></pre>
<p><b>See also </b><a href="qsizef.html#setWidth">setWidth</a>() and <a href="qsizef.html#setHeight">setHeight</a>().</p>
<!-- @@@scale -->
<!-- $$$scale$$$scaleconstQSizeF&Qt::AspectRatioMode -->
<h3 class="fn"><a name="scale-2"></a><span class="type">void</span> QSizeF::<span class="name">scale</span> ( const <span class="type">QSizeF</span> &amp; <i>size</i>, <span class="type"><a href="qt.html#AspectRatioMode-enum">Qt::AspectRatioMode</a></span> <i>mode</i> )</h3>
<p>This is an overloaded function.</p>
<p>Scales the size to a rectangle with the given <i>size</i>, according to the specified <i>mode</i>.</p>
<!-- @@@scale -->
<!-- $$$setHeight[overload1]$$$setHeightqreal -->
<h3 class="fn"><a name="setHeight"></a><span class="type">void</span> QSizeF::<span class="name">setHeight</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>height</i> )</h3>
<p>Sets the height to the given <i>height</i>.</p>
<p><b>See also </b><a href="qsizef.html#height">height</a>(), <a href="qsizef.html#rheight">rheight</a>(), and <a href="qsizef.html#setWidth">setWidth</a>().</p>
<!-- @@@setHeight -->
<!-- $$$setWidth[overload1]$$$setWidthqreal -->
<h3 class="fn"><a name="setWidth"></a><span class="type">void</span> QSizeF::<span class="name">setWidth</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>width</i> )</h3>
<p>Sets the width to the given <i>width</i>.</p>
<p><b>See also </b><a href="qsizef.html#width">width</a>(), <a href="qsizef.html#rwidth">rwidth</a>(), and <a href="qsizef.html#setHeight">setHeight</a>().</p>
<!-- @@@setWidth -->
<!-- $$$toSize[overload1]$$$toSize -->
<h3 class="fn"><a name="toSize"></a><span class="type"><a href="qsize.html">QSize</a></span> QSizeF::<span class="name">toSize</span> () const</h3>
<p>Returns an integer based copy of this size.</p>
<p>Note that the coordinates in the returned size will be rounded to the nearest integer.</p>
<p><b>See also </b><a href="qsizef.html#QSizeF">QSizeF</a>().</p>
<!-- @@@toSize -->
<!-- $$$transpose[overload1]$$$transpose -->
<h3 class="fn"><a name="transpose"></a><span class="type">void</span> QSizeF::<span class="name">transpose</span> ()</h3>
<p>Swaps the width and height values.</p>
<p><b>See also </b><a href="qsizef.html#setWidth">setWidth</a>() and <a href="qsizef.html#setHeight">setHeight</a>().</p>
<!-- @@@transpose -->
<!-- $$$width[overload1]$$$width -->
<h3 class="fn"><a name="width"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QSizeF::<span class="name">width</span> () const</h3>
<p>Returns the width.</p>
<p><b>See also </b><a href="qsizef.html#height">height</a>() and <a href="qsizef.html#setWidth">setWidth</a>().</p>
<!-- @@@width -->
<!-- $$$operator*=[overload1]$$$operator*=qreal -->
<h3 class="fn"><a name="operator-2a-eq"></a><span class="type">QSizeF</span> &amp; QSizeF::<span class="name">operator*=</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>factor</i> )</h3>
<p>This is an overloaded function.</p>
<p>Multiplies both the width and height by the given <i>factor</i> and returns a reference to the size.</p>
<p><b>See also </b><a href="qsizef.html#scale">scale</a>().</p>
<!-- @@@operator*= -->
<!-- $$$operator+=[overload1]$$$operator+=constQSizeF& -->
<h3 class="fn"><a name="operator-2b-eq"></a><span class="type">QSizeF</span> &amp; QSizeF::<span class="name">operator+=</span> ( const <span class="type">QSizeF</span> &amp; <i>size</i> )</h3>
<p>Adds the given <i>size</i> to this size and returns a reference to this size. For example:</p>
<pre class="cpp"> <span class="type"><a href="qsizef.html">QSizeF</a></span> s( <span class="number">3</span><span class="operator">,</span> <span class="number">7</span>);
 <span class="type"><a href="qsizef.html">QSizeF</a></span> r(<span class="operator">-</span><span class="number">1</span><span class="operator">,</span> <span class="number">4</span>);
 s <span class="operator">+</span><span class="operator">=</span> r;

 <span class="comment">// s becomes (2,11)</span></pre>
<!-- @@@operator+= -->
<!-- $$$operator-=[overload1]$$$operator-=constQSizeF& -->
<h3 class="fn"><a name="operator--eq"></a><span class="type">QSizeF</span> &amp; QSizeF::<span class="name">operator-=</span> ( const <span class="type">QSizeF</span> &amp; <i>size</i> )</h3>
<p>Subtracts the given <i>size</i> from this size and returns a reference to this size. For example:</p>
<pre class="cpp"> <span class="type"><a href="qsizef.html">QSizeF</a></span> s( <span class="number">3</span><span class="operator">,</span> <span class="number">7</span>);
 <span class="type"><a href="qsizef.html">QSizeF</a></span> r(<span class="operator">-</span><span class="number">1</span><span class="operator">,</span> <span class="number">4</span>);
 s <span class="operator">-</span><span class="operator">=</span> r;

 <span class="comment">// s becomes (4,3)</span></pre>
<!-- @@@operator-= -->
<!-- $$$operator/=[overload1]$$$operator/=qreal -->
<h3 class="fn"><a name="operator-2f-eq"></a><span class="type">QSizeF</span> &amp; QSizeF::<span class="name">operator/=</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>divisor</i> )</h3>
<p>This is an overloaded function.</p>
<p>Divides both the width and height by the given <i>divisor</i> and returns a reference to the size.</p>
<p><b>See also </b><a href="qsizef.html#scale">scale</a>().</p>
<!-- @@@operator/= -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator!=$$$operator!=constQSizeF&constQSizeF& -->
<h3 class="fn"><a name="operator-not-eq-23"></a><span class="type">bool</span> <span class="name">operator!=</span> ( const <span class="type">QSizeF</span> &amp; <i>s1</i>, const <span class="type">QSizeF</span> &amp; <i>s2</i> )</h3>
<p>Returns true if <i>s1</i> and <i>s2</i> are different; otherwise returns false.</p>
<!-- @@@operator!= -->
<!-- $$$operator*$$$operator*constQSizeF&qreal -->
<h3 class="fn"><a name="operator-2a-59"></a>const <span class="type">QSizeF</span> <span class="name">operator*</span> ( const <span class="type">QSizeF</span> &amp; <i>size</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>factor</i> )</h3>
<p>This is an overloaded function.</p>
<p>Multiplies the given <i>size</i> by the given <i>factor</i> and returns the result.</p>
<p><b>See also </b><a href="qsizef.html#scale">QSizeF::scale</a>().</p>
<!-- @@@operator* -->
<!-- $$$operator*$$$operator*qrealconstQSizeF& -->
<h3 class="fn"><a name="operator-2a-60"></a>const <span class="type">QSizeF</span> <span class="name">operator*</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>factor</i>, const <span class="type">QSizeF</span> &amp; <i>size</i> )</h3>
<p>This is an overloaded function.</p>
<p>Multiplies the given <i>size</i> by the given <i>factor</i> and returns the result.</p>
<!-- @@@operator* -->
<!-- $$$operator+$$$operator+constQSizeF&constQSizeF& -->
<h3 class="fn"><a name="operator-2b-13"></a>const <span class="type">QSizeF</span> <span class="name">operator+</span> ( const <span class="type">QSizeF</span> &amp; <i>s1</i>, const <span class="type">QSizeF</span> &amp; <i>s2</i> )</h3>
<p>Returns the sum of <i>s1</i> and <i>s2</i>; each component is added separately.</p>
<!-- @@@operator+ -->
<!-- $$$operator-$$$operator-constQSizeF&constQSizeF& -->
<h3 class="fn"><a name="operator--4"></a>const <span class="type">QSizeF</span> <span class="name">operator-</span> ( const <span class="type">QSizeF</span> &amp; <i>s1</i>, const <span class="type">QSizeF</span> &amp; <i>s2</i> )</h3>
<p>Returns <i>s2</i> subtracted from <i>s1</i>; each component is subtracted separately.</p>
<!-- @@@operator- -->
<!-- $$$operator/$$$operator/constQSizeF&qreal -->
<h3 class="fn"><a name="operator-2f-12"></a>const <span class="type">QSizeF</span> <span class="name">operator/</span> ( const <span class="type">QSizeF</span> &amp; <i>size</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>divisor</i> )</h3>
<p>This is an overloaded function.</p>
<p>Divides the given <i>size</i> by the given <i>divisor</i> and returns the result.</p>
<p><b>See also </b><a href="qsizef.html#scale">QSizeF::scale</a>().</p>
<!-- @@@operator/ -->
<!-- $$$operator<<$$$operator<<QDataStream&constQSizeF& -->
<h3 class="fn"><a name="operator-lt-lt-32"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <span class="name">operator&lt;&lt;</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>stream</i>, const <span class="type">QSizeF</span> &amp; <i>size</i> )</h3>
<p>Writes the given <i>size</i> to the given <i>stream</i> and returns a reference to the stream.</p>
<p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator==$$$operator==constQSizeF&constQSizeF& -->
<h3 class="fn"><a name="operator-eq-eq-22"></a><span class="type">bool</span> <span class="name">operator==</span> ( const <span class="type">QSizeF</span> &amp; <i>s1</i>, const <span class="type">QSizeF</span> &amp; <i>s2</i> )</h3>
<p>Returns true if <i>s1</i> and <i>s2</i> are equal; otherwise returns false.</p>
<!-- @@@operator== -->
<!-- $$$operator>>$$$operator>>QDataStream&QSizeF& -->
<h3 class="fn"><a name="operator-gt-gt-20"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <span class="name">operator&gt;&gt;</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> &amp; <i>stream</i>, <span class="type">QSizeF</span> &amp; <i>size</i> )</h3>
<p>Reads a size from the given <i>stream</i> into the given <i>size</i> and returns a reference to the stream.</p>
<p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator>> -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</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>