<?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" /> <!-- qpoint.cpp --> <title>Qt 4.8: QPointF 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="qtcore.html">QtCore</a></li> <li>QPointF</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">QPointF Class Reference</h1> <!-- $$$QPointF-brief --> <p>The QPointF class defines a point in the plane using floating point precision. <a href="#details">More...</a></p> <!-- @@@QPointF --> <pre class="cpp"> <span class="preprocessor">#include <QPointF></span></pre><ul> <li><a href="qpointf-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="qpointf.html#QPointF">QPointF</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#QPointF-2">QPointF</a></b> ( const QPoint & <i>point</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#QPointF-3">QPointF</a></b> ( qreal <i>x</i>, qreal <i>y</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#isNull">isNull</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#manhattanLength">manhattanLength</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qreal & </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#rx">rx</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qreal & </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#ry">ry</a></b> ()</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#setX">setX</a></b> ( qreal <i>x</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#setY">setY</a></b> ( qreal <i>y</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QPoint </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#toPoint">toPoint</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#x">x</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> qreal </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#y">y</a></b> () const</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QPointF & </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#operator-2a-eq">operator*=</a></b> ( qreal <i>factor</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QPointF & </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#operator-2b-eq">operator+=</a></b> ( const QPointF & <i>point</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QPointF & </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#operator--eq">operator-=</a></b> ( const QPointF & <i>point</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QPointF & </td><td class="memItemRight bottomAlign"><b><a href="qpointf.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="qpointf.html#operator-not-eq-63">operator!=</a></b> ( const QPointF & <i>p1</i>, const QPointF & <i>p2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const QPointF </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#operator-2a-53">operator*</a></b> ( const QPointF & <i>point</i>, qreal <i>factor</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const QPointF </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#operator-2a-57">operator*</a></b> ( qreal <i>factor</i>, const QPointF & <i>point</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const QPointF </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#operator-2b-39">operator+</a></b> ( const QPointF & <i>p1</i>, const QPointF & <i>p2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const QPointF </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#operator--16">operator-</a></b> ( const QPointF & <i>p1</i>, const QPointF & <i>p2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const QPointF </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#operator--19">operator-</a></b> ( const QPointF & <i>point</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> const QPointF </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#operator-2f-10">operator/</a></b> ( const QPointF & <i>point</i>, qreal <i>divisor</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QDataStream & </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#operator-lt-lt-204">operator<<</a></b> ( QDataStream & <i>stream</i>, const QPointF & <i>point</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#operator-eq-eq-91">operator==</a></b> ( const QPointF & <i>p1</i>, const QPointF & <i>p2</i> )</td></tr> <tr><td class="memItemLeft rightAlign topAlign"> QDataStream & </td><td class="memItemRight bottomAlign"><b><a href="qpointf.html#operator-gt-gt-112">operator>></a></b> ( QDataStream & <i>stream</i>, QPointF & <i>point</i> )</td></tr> </table> <a name="details"></a> <!-- $$$QPointF-description --> <div class="descr"> <h2>Detailed Description</h2> <p>The QPointF class defines a point in the plane using floating point precision.</p> <p>A point is specified by a x coordinate and an y coordinate which can be accessed using the <a href="qpointf.html#x">x</a>() and <a href="qpointf.html#y">y</a>() functions. The coordinates of the point are specified using floating point numbers for accuracy. The <a href="qpointf.html#isNull">isNull</a>() function returns true if both x and y are set to 0.0. The coordinates can be set (or altered) using the <a href="qpointf.html#setX">setX</a>() and <a href="qpointf.html#setY">setY</a>() functions, or alternatively the <a href="qpointf.html#rx">rx</a>() and <a href="qpointf.html#ry">ry</a>() functions which return references to the coordinates (allowing direct manipulation).</p> <p>Given a point <i>p</i>, the following statements are all equivalent:</p> <pre class="cpp"> <span class="type">QPointF</span> p; p<span class="operator">.</span><a href="qpointf.html#setX">setX</a>(p<span class="operator">.</span>x() <span class="operator">+</span> <span class="number">1.0</span>); p <span class="operator">+</span><span class="operator">=</span> <span class="type">QPointF</span>(<span class="number">1.0</span><span class="operator">,</span> <span class="number">0.0</span>); p<span class="operator">.</span><a href="qpointf.html#rx">rx</a>()<span class="operator">+</span><span class="operator">+</span>;</pre> <p>A QPointF object can also be used as a vector: Addition and subtraction are defined as for vectors (each component is added separately). A QPointF object can also be divided or multiplied by an <tt>int</tt> or a <tt>qreal</tt>.</p> <p>In addition, the QPointF class provides a constructor converting a <a href="qpoint.html">QPoint</a> object into a QPointF object, and a corresponding <a href="qpointf.html#toPoint">toPoint</a>() function which returns a <a href="qpoint.html">QPoint</a> copy of <i>this</i> point. Finally, QPointF objects can be streamed as well as compared.</p> </div> <p><b>See also </b><a href="qpoint.html">QPoint</a> and <a href="qpolygonf.html">QPolygonF</a>.</p> <!-- @@@QPointF --> <div class="func"> <h2>Member Function Documentation</h2> <!-- $$$QPointF[overload1]$$$QPointF --> <h3 class="fn"><a name="QPointF"></a>QPointF::<span class="name">QPointF</span> ()</h3> <p>Constructs a null point, i.e. with coordinates (0.0, 0.0)</p> <p><b>See also </b><a href="qpointf.html#isNull">isNull</a>().</p> <!-- @@@QPointF --> <!-- $$$QPointF$$$QPointFconstQPoint& --> <h3 class="fn"><a name="QPointF-2"></a>QPointF::<span class="name">QPointF</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> & <i>point</i> )</h3> <p>Constructs a copy of the given <i>point</i>.</p> <p><b>See also </b><a href="qpointf.html#toPoint">toPoint</a>().</p> <!-- @@@QPointF --> <!-- $$$QPointF$$$QPointFqrealqreal --> <h3 class="fn"><a name="QPointF-3"></a>QPointF::<span class="name">QPointF</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i> )</h3> <p>Constructs a point with the given coordinates (<i>x</i>, <i>y</i>).</p> <p><b>See also </b><a href="qpointf.html#setX">setX</a>() and <a href="qpointf.html#setY">setY</a>().</p> <!-- @@@QPointF --> <!-- $$$isNull[overload1]$$$isNull --> <h3 class="fn"><a name="isNull"></a><span class="type">bool</span> QPointF::<span class="name">isNull</span> () const</h3> <p>Returns true if both the x and y coordinates are set to +0.0; otherwise returns false.</p> <p><b>Note:</b> Since this function treats +0.0 and -0.0 differently, points with zero-valued coordinates where either or both values have a negative sign are not defined to be null points.</p> <!-- @@@isNull --> <!-- $$$manhattanLength[overload1]$$$manhattanLength --> <h3 class="fn"><a name="manhattanLength"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QPointF::<span class="name">manhattanLength</span> () const</h3> <p>Returns the sum of the absolute values of <a href="qpointf.html#x">x</a>() and <a href="qpointf.html#y">y</a>(), traditionally known as the "Manhattan length" of the vector from the origin to the point.</p> <p>This function was introduced in Qt 4.6.</p> <p><b>See also </b><a href="qpoint.html#manhattanLength">QPoint::manhattanLength</a>().</p> <!-- @@@manhattanLength --> <!-- $$$rx[overload1]$$$rx --> <h3 class="fn"><a name="rx"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> & QPointF::<span class="name">rx</span> ()</h3> <p>Returns a reference to the x coordinate of this point.</p> <p>Using a reference makes it possible to directly manipulate x. For example:</p> <pre class="cpp"> <span class="type"><a href="qpointf.html">QPointF</a></span> p(<span class="number">1.1</span><span class="operator">,</span> <span class="number">2.5</span>); p<span class="operator">.</span>rx()<span class="operator">-</span><span class="operator">-</span>; <span class="comment">// p becomes (0.1, 2.5)</span></pre> <p><b>See also </b><a href="qpointf.html#x">x</a>() and <a href="qpointf.html#setX">setX</a>().</p> <!-- @@@rx --> <!-- $$$ry[overload1]$$$ry --> <h3 class="fn"><a name="ry"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> & QPointF::<span class="name">ry</span> ()</h3> <p>Returns a reference to the y coordinate of this point.</p> <p>Using a reference makes it possible to directly manipulate y. For example:</p> <pre class="cpp"> <span class="type"><a href="qpointf.html">QPointF</a></span> p(<span class="number">1.1</span><span class="operator">,</span> <span class="number">2.5</span>); p<span class="operator">.</span>ry()<span class="operator">+</span><span class="operator">+</span>; <span class="comment">// p becomes (1.1, 3.5)</span></pre> <p><b>See also </b><a href="qpointf.html#y">y</a>() and <a href="qpointf.html#setY">setY</a>().</p> <!-- @@@ry --> <!-- $$$setX[overload1]$$$setXqreal --> <h3 class="fn"><a name="setX"></a><span class="type">void</span> QPointF::<span class="name">setX</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>x</i> )</h3> <p>Sets the x coordinate of this point to the given <i>x</i> coordinate.</p> <p><b>See also </b><a href="qpointf.html#x">x</a>() and <a href="qpointf.html#setY">setY</a>().</p> <!-- @@@setX --> <!-- $$$setY[overload1]$$$setYqreal --> <h3 class="fn"><a name="setY"></a><span class="type">void</span> QPointF::<span class="name">setY</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>y</i> )</h3> <p>Sets the y coordinate of this point to the given <i>y</i> coordinate.</p> <p><b>See also </b><a href="qpointf.html#y">y</a>() and <a href="qpointf.html#setX">setX</a>().</p> <!-- @@@setY --> <!-- $$$toPoint[overload1]$$$toPoint --> <h3 class="fn"><a name="toPoint"></a><span class="type"><a href="qpoint.html">QPoint</a></span> QPointF::<span class="name">toPoint</span> () const</h3> <p>Rounds the coordinates of this point to the nearest integer, and returns a <a href="qpoint.html">QPoint</a> object with the rounded coordinates.</p> <p><b>See also </b><a href="qpointf.html#QPointF">QPointF</a>().</p> <!-- @@@toPoint --> <!-- $$$x[overload1]$$$x --> <h3 class="fn"><a name="x"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QPointF::<span class="name">x</span> () const</h3> <p>Returns the x-coordinate of this point.</p> <p><b>See also </b><a href="qpointf.html#setX">setX</a>() and <a href="qpointf.html#rx">rx</a>().</p> <!-- @@@x --> <!-- $$$y[overload1]$$$y --> <h3 class="fn"><a name="y"></a><span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> QPointF::<span class="name">y</span> () const</h3> <p>Returns the y-coordinate of this point.</p> <p><b>See also </b><a href="qpointf.html#setY">setY</a>() and <a href="qpointf.html#ry">ry</a>().</p> <!-- @@@y --> <!-- $$$operator*=[overload1]$$$operator*=qreal --> <h3 class="fn"><a name="operator-2a-eq"></a><span class="type">QPointF</span> & QPointF::<span class="name">operator*=</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>factor</i> )</h3> <p>Multiplies this point's coordinates by the given <i>factor</i>, and returns a reference to this point. For example:</p> <pre class="cpp"> <span class="type"><a href="qpointf.html">QPointF</a></span> p(<span class="operator">-</span><span class="number">1.1</span><span class="operator">,</span> <span class="number">4.1</span>); p <span class="operator">*</span><span class="operator">=</span> <span class="number">2.5</span>; <span class="comment">// p becomes (-2.75, 10.25)</span></pre> <p><b>See also </b><a href="qpointf.html#operator-2f-eq">operator/=</a>().</p> <!-- @@@operator*= --> <!-- $$$operator+=[overload1]$$$operator+=constQPointF& --> <h3 class="fn"><a name="operator-2b-eq"></a><span class="type">QPointF</span> & QPointF::<span class="name">operator+=</span> ( const <span class="type">QPointF</span> & <i>point</i> )</h3> <p>Adds the given <i>point</i> to this point and returns a reference to this point. For example:</p> <pre class="cpp"> <span class="type"><a href="qpointf.html">QPointF</a></span> p( <span class="number">3.1</span><span class="operator">,</span> <span class="number">7.1</span>); <span class="type"><a href="qpointf.html">QPointF</a></span> q(<span class="operator">-</span><span class="number">1.0</span><span class="operator">,</span> <span class="number">4.1</span>); p <span class="operator">+</span><span class="operator">=</span> q; <span class="comment">// p becomes (2.1, 11.2)</span></pre> <p><b>See also </b><a href="qpointf.html#operator--eq">operator-=</a>().</p> <!-- @@@operator+= --> <!-- $$$operator-=[overload1]$$$operator-=constQPointF& --> <h3 class="fn"><a name="operator--eq"></a><span class="type">QPointF</span> & QPointF::<span class="name">operator-=</span> ( const <span class="type">QPointF</span> & <i>point</i> )</h3> <p>Subtracts the given <i>point</i> from this point and returns a reference to this point. For example:</p> <pre class="cpp"> <span class="type"><a href="qpointf.html">QPointF</a></span> p( <span class="number">3.1</span><span class="operator">,</span> <span class="number">7.1</span>); <span class="type"><a href="qpointf.html">QPointF</a></span> q(<span class="operator">-</span><span class="number">1.0</span><span class="operator">,</span> <span class="number">4.1</span>); p <span class="operator">-</span><span class="operator">=</span> q; <span class="comment">// p becomes (4.1, 3.0)</span></pre> <p><b>See also </b><a href="qpointf.html#operator-2b-eq">operator+=</a>().</p> <!-- @@@operator-= --> <!-- $$$operator/=[overload1]$$$operator/=qreal --> <h3 class="fn"><a name="operator-2f-eq"></a><span class="type">QPointF</span> & QPointF::<span class="name">operator/=</span> ( <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>divisor</i> )</h3> <p>Divides both x and y by the given <i>divisor</i>, and returns a reference to this point. For example:</p> <pre class="cpp"> <span class="type"><a href="qpointf.html">QPointF</a></span> p(<span class="operator">-</span><span class="number">2.75</span><span class="operator">,</span> <span class="number">10.25</span>); p <span class="operator">/</span><span class="operator">=</span> <span class="number">2.5</span>; <span class="comment">// p becomes (-1.1, 4.1)</span></pre> <p><b>See also </b><a href="qpointf.html#operator-2a-eq">operator*=</a>().</p> <!-- @@@operator/= --> </div> <div class="relnonmem"> <h2>Related Non-Members</h2> <!-- $$$operator!=$$$operator!=constQPointF&constQPointF& --> <h3 class="fn"><a name="operator-not-eq-63"></a><span class="type">bool</span> <span class="name">operator!=</span> ( const <span class="type">QPointF</span> & <i>p1</i>, const <span class="type">QPointF</span> & <i>p2</i> )</h3> <p>Returns true if <i>p1</i> is not equal to <i>p2</i>; otherwise returns false.</p> <!-- @@@operator!= --> <!-- $$$operator*$$$operator*constQPointF&qreal --> <h3 class="fn"><a name="operator-2a-53"></a>const <span class="type">QPointF</span> <span class="name">operator*</span> ( const <span class="type">QPointF</span> & <i>point</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>factor</i> )</h3> <p>Returns a copy of the given <i>point</i>, multiplied by the given <i>factor</i>.</p> <p><b>See also </b><a href="qpointf.html#operator-2a-eq">QPointF::operator*=</a>().</p> <!-- @@@operator* --> <!-- $$$operator*$$$operator*qrealconstQPointF& --> <h3 class="fn"><a name="operator-2a-57"></a>const <span class="type">QPointF</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">QPointF</span> & <i>point</i> )</h3> <p>This is an overloaded function.</p> <p>Returns a copy of the given <i>point</i>, multiplied by the given <i>factor</i>.</p> <!-- @@@operator* --> <!-- $$$operator+$$$operator+constQPointF&constQPointF& --> <h3 class="fn"><a name="operator-2b-39"></a>const <span class="type">QPointF</span> <span class="name">operator+</span> ( const <span class="type">QPointF</span> & <i>p1</i>, const <span class="type">QPointF</span> & <i>p2</i> )</h3> <p>Returns a <a href="qpointf.html">QPointF</a> object that is the sum of the given points, <i>p1</i> and <i>p2</i>; each component is added separately.</p> <p><b>See also </b><a href="qpointf.html#operator-2b-eq">QPointF::operator+=</a>().</p> <!-- @@@operator+ --> <!-- $$$operator-$$$operator-constQPointF&constQPointF& --> <h3 class="fn"><a name="operator--16"></a>const <span class="type">QPointF</span> <span class="name">operator-</span> ( const <span class="type">QPointF</span> & <i>p1</i>, const <span class="type">QPointF</span> & <i>p2</i> )</h3> <p>Returns a <a href="qpointf.html">QPointF</a> object that is formed by subtracting <i>p2</i> from <i>p1</i>; each component is subtracted separately.</p> <p><b>See also </b><a href="qpointf.html#operator--eq">QPointF::operator-=</a>().</p> <!-- @@@operator- --> <!-- $$$operator-$$$operator-constQPointF& --> <h3 class="fn"><a name="operator--19"></a>const <span class="type">QPointF</span> <span class="name">operator-</span> ( const <span class="type">QPointF</span> & <i>point</i> )</h3> <p>This is an overloaded function.</p> <p>Returns a <a href="qpointf.html">QPointF</a> object that is formed by changing the sign of both components of the given <i>point</i>.</p> <p>Equivalent to <tt>QPointF(0,0) - point</tt>.</p> <!-- @@@operator- --> <!-- $$$operator/$$$operator/constQPointF&qreal --> <h3 class="fn"><a name="operator-2f-10"></a>const <span class="type">QPointF</span> <span class="name">operator/</span> ( const <span class="type">QPointF</span> & <i>point</i>, <span class="type"><a href="qtglobal.html#qreal-typedef">qreal</a></span> <i>divisor</i> )</h3> <p>Returns the <a href="qpointf.html">QPointF</a> object formed by dividing both components of the given <i>point</i> by the given <i>divisor</i>.</p> <p><b>See also </b><a href="qpointf.html#operator-2f-eq">QPointF::operator/=</a>().</p> <!-- @@@operator/ --> <!-- $$$operator<<$$$operator<<QDataStream&constQPointF& --> <h3 class="fn"><a name="operator-lt-lt-204"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> & <span class="name">operator<<</span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> & <i>stream</i>, const <span class="type">QPointF</span> & <i>point</i> )</h3> <p>Writes the given <i>point</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==constQPointF&constQPointF& --> <h3 class="fn"><a name="operator-eq-eq-91"></a><span class="type">bool</span> <span class="name">operator==</span> ( const <span class="type">QPointF</span> & <i>p1</i>, const <span class="type">QPointF</span> & <i>p2</i> )</h3> <p>Returns true if <i>p1</i> is equal to <i>p2</i>; otherwise returns false.</p> <!-- @@@operator== --> <!-- $$$operator>>$$$operator>>QDataStream&QPointF& --> <h3 class="fn"><a name="operator-gt-gt-112"></a><span class="type"><a href="qdatastream.html">QDataStream</a></span> & <span class="name">operator>></span> ( <span class="type"><a href="qdatastream.html">QDataStream</a></span> & <i>stream</i>, <span class="type">QPointF</span> & <i>point</i> )</h3> <p>Reads a point from the given <i>stream</i> into the given <i>point</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">©</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>