~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/qvector2d.html

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- qvector2d.cpp -->
 
6
<head>
 
7
  <title>Qt 4.6: QVector2D Class Reference</title>
 
8
  <link href="classic.css" rel="stylesheet" type="text/css" />
 
9
</head>
 
10
<body>
 
11
<a name="//apple_ref/cpp/cl//QVector2D" />
 
12
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
13
<tr>
 
14
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
 
15
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td><td class="searchBar" align="right" valign="center"><form action="http://www.google.com/cse" id="cse-search-box"><div><input type="hidden" name="cx" value="000136343326384750312:dhbxnqlakyu" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" size="31" /><input type="submit" name="sa" value="Search" /></div></form></td>
 
16
</tr></table><h1 class="title">QVector2D Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
 
17
</h1>
 
18
<p>The QVector2D class represents a vector or vertex in 2D space. <a href="#details">More...</a></p>
 
19
<pre> #include &lt;QVector2D&gt;</pre><p>This class was introduced in Qt 4.6.</p>
 
20
<ul>
 
21
<li><a href="qvector2d-members.html">List of all members, including inherited members</a></li>
 
22
</ul>
 
23
<hr />
 
24
<a name="public-functions"></a>
 
25
<h2>Public Functions</h2>
 
26
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
 
27
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#QVector2D">QVector2D</a></b> ()</td></tr>
 
28
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#QVector2D-2">QVector2D</a></b> ( qreal <i>xpos</i>, qreal <i>ypos</i> )</td></tr>
 
29
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#QVector2D-3">QVector2D</a></b> ( const QPoint &amp; <i>point</i> )</td></tr>
 
30
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#QVector2D-4">QVector2D</a></b> ( const QPointF &amp; <i>point</i> )</td></tr>
 
31
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#QVector2D-5">QVector2D</a></b> ( const QVector3D &amp; <i>vector</i> )</td></tr>
 
32
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#QVector2D-6">QVector2D</a></b> ( const QVector4D &amp; <i>vector</i> )</td></tr>
 
33
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#isNull">isNull</a></b> () const</td></tr>
 
34
<tr><td class="memItemLeft" align="right" valign="top">qreal </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#length">length</a></b> () const</td></tr>
 
35
<tr><td class="memItemLeft" align="right" valign="top">qreal </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#lengthSquared">lengthSquared</a></b> () const</td></tr>
 
36
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#normalize">normalize</a></b> ()</td></tr>
 
37
<tr><td class="memItemLeft" align="right" valign="top">QVector2D </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#normalized">normalized</a></b> () const</td></tr>
 
38
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#setX">setX</a></b> ( qreal <i>x</i> )</td></tr>
 
39
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#setY">setY</a></b> ( qreal <i>y</i> )</td></tr>
 
40
<tr><td class="memItemLeft" align="right" valign="top">QPoint </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#toPoint">toPoint</a></b> () const</td></tr>
 
41
<tr><td class="memItemLeft" align="right" valign="top">QPointF </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#toPointF">toPointF</a></b> () const</td></tr>
 
42
<tr><td class="memItemLeft" align="right" valign="top">QVector3D </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#toVector3D">toVector3D</a></b> () const</td></tr>
 
43
<tr><td class="memItemLeft" align="right" valign="top">QVector4D </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#toVector4D">toVector4D</a></b> () const</td></tr>
 
44
<tr><td class="memItemLeft" align="right" valign="top">qreal </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#x">x</a></b> () const</td></tr>
 
45
<tr><td class="memItemLeft" align="right" valign="top">qreal </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#y">y</a></b> () const</td></tr>
 
46
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator-QVariant">operator QVariant</a></b> () const</td></tr>
 
47
<tr><td class="memItemLeft" align="right" valign="top">QVector2D &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator-2a-eq">operator*=</a></b> ( qreal <i>factor</i> )</td></tr>
 
48
<tr><td class="memItemLeft" align="right" valign="top">QVector2D &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator-2a-eq-2">operator*=</a></b> ( const QVector2D &amp; <i>vector</i> )</td></tr>
 
49
<tr><td class="memItemLeft" align="right" valign="top">QVector2D &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator-2b-eq">operator+=</a></b> ( const QVector2D &amp; <i>vector</i> )</td></tr>
 
50
<tr><td class="memItemLeft" align="right" valign="top">QVector2D &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator--eq">operator-=</a></b> ( const QVector2D &amp; <i>vector</i> )</td></tr>
 
51
<tr><td class="memItemLeft" align="right" valign="top">QVector2D &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator-2f-eq">operator/=</a></b> ( qreal <i>divisor</i> )</td></tr>
 
52
</table>
 
53
<hr />
 
54
<a name="static-public-members"></a>
 
55
<h2>Static Public Members</h2>
 
56
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
 
57
<tr><td class="memItemLeft" align="right" valign="top">qreal </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#dotProduct">dotProduct</a></b> ( const QVector2D &amp; <i>v1</i>, const QVector2D &amp; <i>v2</i> )</td></tr>
 
58
</table>
 
59
<hr />
 
60
<a name="related-non-members"></a>
 
61
<h2>Related Non-Members</h2>
 
62
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
 
63
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#qFuzzyCompare-4">qFuzzyCompare</a></b> ( const QVector2D &amp; <i>v1</i>, const QVector2D &amp; <i>v2</i> )</td></tr>
 
64
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator-not-eq-15">operator!=</a></b> ( const QVector2D &amp; <i>v1</i>, const QVector2D &amp; <i>v2</i> )</td></tr>
 
65
<tr><td class="memItemLeft" align="right" valign="top">const QVector2D </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator-2a-21">operator*</a></b> ( qreal <i>factor</i>, const QVector2D &amp; <i>vector</i> )</td></tr>
 
66
<tr><td class="memItemLeft" align="right" valign="top">const QVector2D </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator-2a-22">operator*</a></b> ( const QVector2D &amp; <i>vector</i>, qreal <i>factor</i> )</td></tr>
 
67
<tr><td class="memItemLeft" align="right" valign="top">const QVector2D </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator-2a-23">operator*</a></b> ( const QVector2D &amp; <i>v1</i>, const QVector2D &amp; <i>v2</i> )</td></tr>
 
68
<tr><td class="memItemLeft" align="right" valign="top">const QVector2D </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator-2b-11">operator+</a></b> ( const QVector2D &amp; <i>v1</i>, const QVector2D &amp; <i>v2</i> )</td></tr>
 
69
<tr><td class="memItemLeft" align="right" valign="top">const QVector2D </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator--8">operator-</a></b> ( const QVector2D &amp; <i>v1</i>, const QVector2D &amp; <i>v2</i> )</td></tr>
 
70
<tr><td class="memItemLeft" align="right" valign="top">const QVector2D </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator--24">operator-</a></b> ( const QVector2D &amp; <i>vector</i> )</td></tr>
 
71
<tr><td class="memItemLeft" align="right" valign="top">const QVector2D </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator-2f-5">operator/</a></b> ( const QVector2D &amp; <i>vector</i>, qreal <i>divisor</i> )</td></tr>
 
72
<tr><td class="memItemLeft" align="right" valign="top">QDataStream &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator-lt-lt-90">operator&lt;&lt;</a></b> ( QDataStream &amp; <i>stream</i>, const QVector2D &amp; <i>vector</i> )</td></tr>
 
73
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator-eq-eq-21">operator==</a></b> ( const QVector2D &amp; <i>v1</i>, const QVector2D &amp; <i>v2</i> )</td></tr>
 
74
<tr><td class="memItemLeft" align="right" valign="top">QDataStream &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qvector2d.html#operator-gt-gt-49">operator&gt;&gt;</a></b> ( QDataStream &amp; <i>stream</i>, QVector2D &amp; <i>vector</i> )</td></tr>
 
75
</table>
 
76
<a name="details"></a>
 
77
<hr />
 
78
<h2>Detailed Description</h2>
 
79
<p>The QVector2D class represents a vector or vertex in 2D space.</p>
 
80
<p>The QVector2D class can also be used to represent vertices in 2D space. We therefore do not need to provide a separate vertex class.</p>
 
81
<p>See also <a href="qvector3d.html">QVector3D</a>, <a href="qvector4d.html">QVector4D</a>, and <a href="qquaternion.html">QQuaternion</a>.</p>
 
82
<hr />
 
83
<h2>Member Function Documentation</h2>
 
84
<a name="//apple_ref/cpp/instm/QVector2D/QVector2D" />
 
85
<h3 class="fn"><a name="QVector2D"></a>QVector2D::QVector2D ()</h3>
 
86
<p>Constructs a null vector, i.e&#x2e; with coordinates (0, 0, 0).</p>
 
87
<h3 class="fn"><a name="QVector2D-2"></a>QVector2D::QVector2D ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>xpos</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>ypos</i> )</h3>
 
88
<p>Constructs a vector with coordinates (<i>xpos</i>, <i>ypos</i>).</p>
 
89
<h3 class="fn"><a name="QVector2D-3"></a>QVector2D::QVector2D ( const <a href="qpoint.html">QPoint</a> &amp; <i>point</i> )</h3>
 
90
<p>Constructs a vector with x and y coordinates from a 2D <i>point</i>.</p>
 
91
<h3 class="fn"><a name="QVector2D-4"></a>QVector2D::QVector2D ( const <a href="qpointf.html">QPointF</a> &amp; <i>point</i> )</h3>
 
92
<p>Constructs a vector with x and y coordinates from a 2D <i>point</i>.</p>
 
93
<h3 class="fn"><a name="QVector2D-5"></a>QVector2D::QVector2D ( const <a href="qvector3d.html">QVector3D</a> &amp; <i>vector</i> )</h3>
 
94
<p>Constructs a vector with x and y coordinates from a 3D <i>vector</i>. The z coordinate of <i>vector</i> is dropped.</p>
 
95
<p>See also <a href="qvector2d.html#toVector3D">toVector3D</a>().</p>
 
96
<h3 class="fn"><a name="QVector2D-6"></a>QVector2D::QVector2D ( const <a href="qvector4d.html">QVector4D</a> &amp; <i>vector</i> )</h3>
 
97
<p>Constructs a vector with x and y coordinates from a 3D <i>vector</i>. The z and w coordinates of <i>vector</i> are dropped.</p>
 
98
<p>See also <a href="qvector2d.html#toVector4D">toVector4D</a>().</p>
 
99
<a name="//apple_ref/cpp/clm/QVector2D/dotProduct" />
 
100
<h3 class="fn"><a name="dotProduct"></a><a href="qtglobal.html#qreal-typedef">qreal</a> QVector2D::dotProduct ( const QVector2D &amp; <i>v1</i>, const QVector2D &amp; <i>v2</i> )&nbsp;&nbsp;<tt> [static]</tt></h3>
 
101
<p>Returns the dot product of <i>v1</i> and <i>v2</i>.</p>
 
102
<a name="//apple_ref/cpp/instm/QVector2D/isNull" />
 
103
<h3 class="fn"><a name="isNull"></a>bool QVector2D::isNull () const</h3>
 
104
<p>Returns true if the x and y coordinates are set to 0.0, otherwise returns false.</p>
 
105
<a name="//apple_ref/cpp/instm/QVector2D/length" />
 
106
<h3 class="fn"><a name="length"></a><a href="qtglobal.html#qreal-typedef">qreal</a> QVector2D::length () const</h3>
 
107
<p>Returns the length of the vector from the origin.</p>
 
108
<p>See also <a href="qvector2d.html#lengthSquared">lengthSquared</a>() and <a href="qvector2d.html#normalized">normalized</a>().</p>
 
109
<a name="//apple_ref/cpp/instm/QVector2D/lengthSquared" />
 
110
<h3 class="fn"><a name="lengthSquared"></a><a href="qtglobal.html#qreal-typedef">qreal</a> QVector2D::lengthSquared () const</h3>
 
111
<p>Returns the squared length of the vector from the origin. This is equivalent to the dot product of the vector with itself.</p>
 
112
<p>See also <a href="qvector2d.html#length">length</a>() and <a href="qvector2d.html#dotProduct">dotProduct</a>().</p>
 
113
<a name="//apple_ref/cpp/instm/QVector2D/normalize" />
 
114
<h3 class="fn"><a name="normalize"></a>void QVector2D::normalize ()</h3>
 
115
<p>Normalizes the currect vector in place. Nothing happens if this vector is a null vector or the length of the vector is very close to 1.</p>
 
116
<p>See also <a href="qvector2d.html#length">length</a>() and <a href="qvector2d.html#normalized">normalized</a>().</p>
 
117
<a name="//apple_ref/cpp/instm/QVector2D/normalized" />
 
118
<h3 class="fn"><a name="normalized"></a>QVector2D QVector2D::normalized () const</h3>
 
119
<p>Returns the normalized unit vector form of this vector.</p>
 
120
<p>If this vector is null, then a null vector is returned. If the length of the vector is very close to 1, then the vector will be returned as-is. Otherwise the normalized form of the vector of length 1 will be returned.</p>
 
121
<p>See also <a href="qvector2d.html#length">length</a>() and <a href="qvector2d.html#normalize">normalize</a>().</p>
 
122
<a name="//apple_ref/cpp/instm/QVector2D/setX" />
 
123
<h3 class="fn"><a name="setX"></a>void QVector2D::setX ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>x</i> )</h3>
 
124
<p>Sets the x coordinate of this point to the given <i>x</i> coordinate.</p>
 
125
<p>See also <a href="qvector2d.html#x">x</a>() and <a href="qvector2d.html#setY">setY</a>().</p>
 
126
<a name="//apple_ref/cpp/instm/QVector2D/setY" />
 
127
<h3 class="fn"><a name="setY"></a>void QVector2D::setY ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>y</i> )</h3>
 
128
<p>Sets the y coordinate of this point to the given <i>y</i> coordinate.</p>
 
129
<p>See also <a href="qvector2d.html#y">y</a>() and <a href="qvector2d.html#setX">setX</a>().</p>
 
130
<a name="//apple_ref/cpp/instm/QVector2D/toPoint" />
 
131
<h3 class="fn"><a name="toPoint"></a><a href="qpoint.html">QPoint</a> QVector2D::toPoint () const</h3>
 
132
<p>Returns the <a href="qpoint.html">QPoint</a> form of this 2D vector.</p>
 
133
<p>See also <a href="qvector2d.html#toPointF">toPointF</a>() and <a href="qvector2d.html#toVector3D">toVector3D</a>().</p>
 
134
<a name="//apple_ref/cpp/instm/QVector2D/toPointF" />
 
135
<h3 class="fn"><a name="toPointF"></a><a href="qpointf.html">QPointF</a> QVector2D::toPointF () const</h3>
 
136
<p>Returns the <a href="qpointf.html">QPointF</a> form of this 2D vector.</p>
 
137
<p>See also <a href="qvector2d.html#toPoint">toPoint</a>() and <a href="qvector2d.html#toVector3D">toVector3D</a>().</p>
 
138
<a name="//apple_ref/cpp/instm/QVector2D/toVector3D" />
 
139
<h3 class="fn"><a name="toVector3D"></a><a href="qvector3d.html">QVector3D</a> QVector2D::toVector3D () const</h3>
 
140
<p>Returns the 3D form of this 2D vector, with the z coordinate set to zero.</p>
 
141
<p>See also <a href="qvector2d.html#toVector4D">toVector4D</a>() and <a href="qvector2d.html#toPoint">toPoint</a>().</p>
 
142
<a name="//apple_ref/cpp/instm/QVector2D/toVector4D" />
 
143
<h3 class="fn"><a name="toVector4D"></a><a href="qvector4d.html">QVector4D</a> QVector2D::toVector4D () const</h3>
 
144
<p>Returns the 4D form of this 2D vector, with the z and w coordinates set to zero.</p>
 
145
<p>See also <a href="qvector2d.html#toVector3D">toVector3D</a>() and <a href="qvector2d.html#toPoint">toPoint</a>().</p>
 
146
<a name="//apple_ref/cpp/instm/QVector2D/x" />
 
147
<h3 class="fn"><a name="x"></a><a href="qtglobal.html#qreal-typedef">qreal</a> QVector2D::x () const</h3>
 
148
<p>Returns the x coordinate of this point.</p>
 
149
<p>See also <a href="qvector2d.html#setX">setX</a>() and <a href="qvector2d.html#y">y</a>().</p>
 
150
<a name="//apple_ref/cpp/instm/QVector2D/y" />
 
151
<h3 class="fn"><a name="y"></a><a href="qtglobal.html#qreal-typedef">qreal</a> QVector2D::y () const</h3>
 
152
<p>Returns the y coordinate of this point.</p>
 
153
<p>See also <a href="qvector2d.html#setY">setY</a>() and <a href="qvector2d.html#x">x</a>().</p>
 
154
<a name="//apple_ref/cpp/instm/QVector2D/operator QVariant" />
 
155
<h3 class="fn"><a name="operator-QVariant"></a>QVector2D::operator QVariant () const</h3>
 
156
<p>Returns the 2D vector as a <a href="qvariant.html">QVariant</a>.</p>
 
157
<a name="//apple_ref/cpp/instm/QVector2D/operator*=" />
 
158
<h3 class="fn"><a name="operator-2a-eq"></a>QVector2D &amp; QVector2D::operator*= ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>factor</i> )</h3>
 
159
<p>Multiplies this vector's coordinates by the given <i>factor</i>, and returns a reference to this vector.</p>
 
160
<p>See also <a href="qvector2d.html#operator-2f-eq">operator/=</a>().</p>
 
161
<h3 class="fn"><a name="operator-2a-eq-2"></a>QVector2D &amp; QVector2D::operator*= ( const QVector2D &amp; <i>vector</i> )</h3>
 
162
<p>Multiplies the components of this vector by the corresponding components in <i>vector</i>.</p>
 
163
<a name="//apple_ref/cpp/instm/QVector2D/operator+=" />
 
164
<h3 class="fn"><a name="operator-2b-eq"></a>QVector2D &amp; QVector2D::operator+= ( const QVector2D &amp; <i>vector</i> )</h3>
 
165
<p>Adds the given <i>vector</i> to this vector and returns a reference to this vector.</p>
 
166
<p>See also <a href="qvector2d.html#operator--eq">operator-=</a>().</p>
 
167
<a name="//apple_ref/cpp/instm/QVector2D/operator-=" />
 
168
<h3 class="fn"><a name="operator--eq"></a>QVector2D &amp; QVector2D::operator-= ( const QVector2D &amp; <i>vector</i> )</h3>
 
169
<p>Subtracts the given <i>vector</i> from this vector and returns a reference to this vector.</p>
 
170
<p>See also <a href="qvector2d.html#operator-2b-eq">operator+=</a>().</p>
 
171
<a name="//apple_ref/cpp/instm/QVector2D/operator/=" />
 
172
<h3 class="fn"><a name="operator-2f-eq"></a>QVector2D &amp; QVector2D::operator/= ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>divisor</i> )</h3>
 
173
<p>Divides this vector's coordinates by the given <i>divisor</i>, and returns a reference to this vector.</p>
 
174
<p>See also <a href="qvector2d.html#operator-2a-eq">operator*=</a>().</p>
 
175
<hr />
 
176
<h2>Related Non-Members</h2>
 
177
<h3 class="fn"><a name="qFuzzyCompare-4"></a>bool qFuzzyCompare ( const QVector2D &amp; <i>v1</i>, const QVector2D &amp; <i>v2</i> )</h3>
 
178
<p>Returns true if <i>v1</i> and <i>v2</i> are equal, allowing for a small fuzziness factor for floating-point comparisons; false otherwise.</p>
 
179
<h3 class="fn"><a name="operator-not-eq-15"></a>bool operator!= ( const QVector2D &amp; <i>v1</i>, const QVector2D &amp; <i>v2</i> )</h3>
 
180
<p>Returns true if <i>v1</i> is not equal to <i>v2</i>; otherwise returns false. This operator uses an exact floating-point comparison.</p>
 
181
<h3 class="fn"><a name="operator-2a-21"></a>const QVector2D operator* ( <a href="qtglobal.html#qreal-typedef">qreal</a> <i>factor</i>, const QVector2D &amp; <i>vector</i> )</h3>
 
182
<p>Returns a copy of the given <i>vector</i>, multiplied by the given <i>factor</i>.</p>
 
183
<p>See also <a href="qvector2d.html#operator-2a-eq">QVector2D::operator*=</a>().</p>
 
184
<h3 class="fn"><a name="operator-2a-22"></a>const QVector2D operator* ( const QVector2D &amp; <i>vector</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>factor</i> )</h3>
 
185
<p>Returns a copy of the given <i>vector</i>, multiplied by the given <i>factor</i>.</p>
 
186
<p>See also <a href="qvector2d.html#operator-2a-eq">QVector2D::operator*=</a>().</p>
 
187
<h3 class="fn"><a name="operator-2a-23"></a>const QVector2D operator* ( const QVector2D &amp; <i>v1</i>, const QVector2D &amp; <i>v2</i> )</h3>
 
188
<p>Multiplies the components of <i>v1</i> by the corresponding components in <i>v2</i>.</p>
 
189
<h3 class="fn"><a name="operator-2b-11"></a>const QVector2D operator+ ( const QVector2D &amp; <i>v1</i>, const QVector2D &amp; <i>v2</i> )</h3>
 
190
<p>Returns a <a href="qvector2d.html">QVector2D</a> object that is the sum of the given vectors, <i>v1</i> and <i>v2</i>; each component is added separately.</p>
 
191
<p>See also <a href="qvector2d.html#operator-2b-eq">QVector2D::operator+=</a>().</p>
 
192
<h3 class="fn"><a name="operator--8"></a>const QVector2D operator- ( const QVector2D &amp; <i>v1</i>, const QVector2D &amp; <i>v2</i> )</h3>
 
193
<p>Returns a <a href="qvector2d.html">QVector2D</a> object that is formed by subtracting <i>v2</i> from <i>v1</i>; each component is subtracted separately.</p>
 
194
<p>See also <a href="qvector2d.html#operator--eq">QVector2D::operator-=</a>().</p>
 
195
<h3 class="fn"><a name="operator--24"></a>const QVector2D operator- ( const QVector2D &amp; <i>vector</i> )</h3>
 
196
<p>This is an overloaded function.</p>
 
197
<p>Returns a <a href="qvector2d.html">QVector2D</a> object that is formed by changing the sign of the components of the given <i>vector</i>.</p>
 
198
<p>Equivalent to <tt>QVector2D(0,0) - vector</tt>.</p>
 
199
<h3 class="fn"><a name="operator-2f-5"></a>const QVector2D operator/ ( const QVector2D &amp; <i>vector</i>, <a href="qtglobal.html#qreal-typedef">qreal</a> <i>divisor</i> )</h3>
 
200
<p>Returns the <a href="qvector2d.html">QVector2D</a> object formed by dividing all three components of the given <i>vector</i> by the given <i>divisor</i>.</p>
 
201
<p>See also <a href="qvector2d.html#operator-2f-eq">QVector2D::operator/=</a>().</p>
 
202
<h3 class="fn"><a name="operator-lt-lt-90"></a><a href="qdatastream.html">QDataStream</a> &amp; operator&lt;&lt; ( <a href="qdatastream.html">QDataStream</a> &amp; <i>stream</i>, const QVector2D &amp; <i>vector</i> )</h3>
 
203
<p>Writes the given <i>vector</i> to the given <i>stream</i> and returns a reference to the stream.</p>
 
204
<p>See also <a href="datastreamformat.html">Format of the QDataStream Operators</a>.</p>
 
205
<h3 class="fn"><a name="operator-eq-eq-21"></a>bool operator== ( const QVector2D &amp; <i>v1</i>, const QVector2D &amp; <i>v2</i> )</h3>
 
206
<p>Returns true if <i>v1</i> is equal to <i>v2</i>; otherwise returns false. This operator uses an exact floating-point comparison.</p>
 
207
<h3 class="fn"><a name="operator-gt-gt-49"></a><a href="qdatastream.html">QDataStream</a> &amp; operator&gt;&gt; ( <a href="qdatastream.html">QDataStream</a> &amp; <i>stream</i>, QVector2D &amp; <i>vector</i> )</h3>
 
208
<p>Reads a 2D vector from the given <i>stream</i> into the given <i>vector</i> and returns a reference to the stream.</p>
 
209
<p>See also <a href="datastreamformat.html">Format of the QDataStream Operators</a>.</p>
 
210
<p /><address><hr /><div align="center">
 
211
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
212
<td width="40%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
 
213
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
214
<td width="40%" align="right"><div align="right">Qt 4.6.0</div></td>
 
215
<script type="text/javascript" src="http://www.google.com/jsapi"></script><script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script><script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse-search-box&t13n_langs=en"></script><script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script></tr></table></div></address></body>
 
216
</html>