1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
|
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QPolygon Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">  </td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a> · <a href="classes.html"><font color="#004faf">All Classes</font></a> · <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QPolygon Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QPolygon class provides a vector of points using integer
precision. <a href="#details">More...</a></p>
<h3>Methods</h3><ul><li><div class="fn" /><b><a href="qpolygon.html#QPolygon">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#QPolygon-2">__init__</a></b> (<i>self</i>, QPolygon <i>a</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#QPolygon-3">__init__</a></b> (<i>self</i>, list-of-QPoint <i>v</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#QPolygon-4">__init__</a></b> (<i>self</i>, QRect <i>rectangle</i>, bool <i>closed</i> = False)</li><li><div class="fn" /><b><a href="qpolygon.html#QPolygon-5">__init__</a></b> (<i>self</i>, int <i>asize</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#QPolygon-6">__init__</a></b> (<i>self</i>, list-of-int <i>points</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#QPolygon-7">__init__</a></b> (<i>self</i>, QVariant <i>variant</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#append">append</a></b> (<i>self</i>, QPoint <i>value</i>)</li><li><div class="fn" />QPoint <b><a href="qpolygon.html#at">at</a></b> (<i>self</i>, int <i>i</i>)</li><li><div class="fn" />QRect <b><a href="qpolygon.html#boundingRect">boundingRect</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#clear">clear</a></b> (<i>self</i>)</li><li><div class="fn" />bool <b><a href="qpolygon.html#contains">contains</a></b> (<i>self</i>, QPoint <i>value</i>)</li><li><div class="fn" />bool <b><a href="qpolygon.html#containsPoint">containsPoint</a></b> (<i>self</i>, QPoint <i>pt</i>, Qt.FillRule <i>fillRule</i>)</li><li><div class="fn" />int <b><a href="qpolygon.html#count">count</a></b> (<i>self</i>, QPoint <i>value</i>)</li><li><div class="fn" />int <b><a href="qpolygon.html#count-2">count</a></b> (<i>self</i>)</li><li><div class="fn" />sip.voidptr <b><a href="qpolygon.html#data">data</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#fill">fill</a></b> (<i>self</i>, QPoint <i>value</i>, int <i>size</i> = -1)</li><li><div class="fn" />QPoint <b><a href="qpolygon.html#first">first</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qpolygon.html#indexOf">indexOf</a></b> (<i>self</i>, QPoint <i>value</i>, int <i>from</i> = 0)</li><li><div class="fn" /><b><a href="qpolygon.html#insert">insert</a></b> (<i>self</i>, int <i>i</i>, QPoint <i>value</i>)</li><li><div class="fn" />QPolygon <b><a href="qpolygon.html#intersected">intersected</a></b> (<i>self</i>, QPolygon <i>r</i>)</li><li><div class="fn" />bool <b><a href="qpolygon.html#isEmpty">isEmpty</a></b> (<i>self</i>)</li><li><div class="fn" />QPoint <b><a href="qpolygon.html#last">last</a></b> (<i>self</i>)</li><li><div class="fn" />int <b><a href="qpolygon.html#lastIndexOf">lastIndexOf</a></b> (<i>self</i>, QPoint <i>value</i>, int <i>from</i> = -1)</li><li><div class="fn" />QPolygon <b><a href="qpolygon.html#mid">mid</a></b> (<i>self</i>, int <i>pos</i>, int <i>length</i> = -1)</li><li><div class="fn" />QPoint <b><a href="qpolygon.html#point">point</a></b> (<i>self</i>, int <i>index</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#prepend">prepend</a></b> (<i>self</i>, QPoint <i>value</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#putPoints">putPoints</a></b> (<i>self</i>, int <i>index</i>, int <i>firstx</i>, int <i>firsty</i>, ...)</li><li><div class="fn" /><b><a href="qpolygon.html#putPoints-2">putPoints</a></b> (<i>self</i>, int <i>index</i>, int <i>nPoints</i>, QPolygon <i>fromPolygon</i>, int <i>from</i> = 0)</li><li><div class="fn" /><b><a href="qpolygon.html#remove">remove</a></b> (<i>self</i>, int <i>i</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#remove-2">remove</a></b> (<i>self</i>, int <i>i</i>, int <i>count</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#replace">replace</a></b> (<i>self</i>, int <i>i</i>, QPoint <i>value</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#setPoint">setPoint</a></b> (<i>self</i>, int <i>index</i>, QPoint <i>pt</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#setPoint-2">setPoint</a></b> (<i>self</i>, int <i>index</i>, int <i>x</i>, int <i>y</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#setPoints">setPoints</a></b> (<i>self</i>, list-of-int <i>points</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#setPoints-2">setPoints</a></b> (<i>self</i>, int <i>firstx</i>, int <i>firsty</i>, ...)</li><li><div class="fn" />int <b><a href="qpolygon.html#size">size</a></b> (<i>self</i>)</li><li><div class="fn" />QPolygon <b><a href="qpolygon.html#subtracted">subtracted</a></b> (<i>self</i>, QPolygon <i>r</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#swap">swap</a></b> (<i>self</i>, QPolygon <i>other</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#translate">translate</a></b> (<i>self</i>, int <i>dx</i>, int <i>dy</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#translate-2">translate</a></b> (<i>self</i>, QPoint <i>offset</i>)</li><li><div class="fn" />QPolygon <b><a href="qpolygon.html#translated">translated</a></b> (<i>self</i>, int <i>dx</i>, int <i>dy</i>)</li><li><div class="fn" />QPolygon <b><a href="qpolygon.html#translated-2">translated</a></b> (<i>self</i>, QPoint <i>offset</i>)</li><li><div class="fn" />QPolygon <b><a href="qpolygon.html#united">united</a></b> (<i>self</i>, QPolygon <i>r</i>)</li><li><div class="fn" />QPoint <b><a href="qpolygon.html#value">value</a></b> (<i>self</i>, int <i>i</i>)</li><li><div class="fn" />QPoint <b><a href="qpolygon.html#value-2">value</a></b> (<i>self</i>, int <i>i</i>, QPoint <i>defaultValue</i>)</li></ul><h3>Special Methods</h3><ul><li><div class="fn" />QPolygon <b><a href="qpolygon.html#__add__">__add__</a></b> (<i>self</i>, QPolygon <i>other</i>)</li><li><div class="fn" />int <b><a href="qpolygon.html#__contains__">__contains__</a></b> (<i>self</i>, QPoint <i>value</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#__delitem__">__delitem__</a></b> (<i>self</i>, int <i>i</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#__delitem__-2">__delitem__</a></b> (<i>self</i>, slice <i>slice</i>)</li><li><div class="fn" />bool <b><a href="qpolygon.html#__eq__">__eq__</a></b> (<i>self</i>, QPolygon <i>other</i>)</li><li><div class="fn" />QPoint <b><a href="qpolygon.html#__getitem__">__getitem__</a></b> (<i>self</i>, int <i>i</i>)</li><li><div class="fn" />QPolygon <b><a href="qpolygon.html#__getitem__-2">__getitem__</a></b> (<i>self</i>, slice <i>slice</i>)</li><li><div class="fn" />QPolygon <b><a href="qpolygon.html#__iadd__">__iadd__</a></b> (<i>self</i>, QPolygon <i>other</i>)</li><li><div class="fn" />QPolygon <b><a href="qpolygon.html#__iadd__-2">__iadd__</a></b> (<i>self</i>, QPoint <i>value</i>)</li><li><div class="fn" /> <b><a href="qpolygon.html#__len__">__len__</a></b> (<i>self</i>)</li><li><div class="fn" />object <b><a href="qpolygon.html#__lshift__">__lshift__</a></b> (<i>self</i>, QPoint <i>value</i>)</li><li><div class="fn" />QPolygon <b><a href="qpolygon.html#__mul__">__mul__</a></b> (<i>self</i>, QMatrix <i>m</i>)</li><li><div class="fn" />QPolygon <b><a href="qpolygon.html#__mul__-2">__mul__</a></b> (<i>self</i>, QTransform <i>m</i>)</li><li><div class="fn" />bool <b><a href="qpolygon.html#__ne__">__ne__</a></b> (<i>self</i>, QPolygon <i>other</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#__setitem__">__setitem__</a></b> (<i>self</i>, int <i>i</i>, QPoint <i>value</i>)</li><li><div class="fn" /><b><a href="qpolygon.html#__setitem__-2">__setitem__</a></b> (<i>self</i>, slice <i>slice</i>, QPolygon <i>list</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>This class can be pickled.</p><p>The QPolygon class provides a vector of points using integer
precision.</p>
<p>A QPolygon object is a <a href="qvector.html">QVector</a><<a href="qpoint.html">QPoint</a>>.
The easiest way to add points to a QPolygon is to use <a href="qvector.html">QVector</a>'s streaming operator, as illustrated
below:</p>
<pre class="cpp">
<span class="type">QPolygon</span> polygon;
polygon <span class="operator"><</span><span class="operator"><</span> <span class="type"><a href="qpoint.html">QPoint</a></span>(<span class="number">10</span><span class="operator">,</span> <span class="number">20</span>) <span class="operator"><</span><span class="operator"><</span> <span class="type"><a href="qpoint.html">QPoint</a></span>(<span class="number">20</span><span class="operator">,</span> <span class="number">30</span>);
</pre>
<p>In addition to the functions provided by <a href="qvector.html">QVector</a>, QPolygon provides some point-specific
functions.</p>
<p>Each point in a polygon can be retrieved by passing its index to
the <a href="qpolygon.html#point">point</a>() function. To populate
the polygon, QPolygon provides the <a href="qpolygon.html#setPoint">setPoint</a>() function to set the point
at a given index, the <a href="qpolygon.html#setPoints">setPoints</a>() function to set all the
points in the polygon (resizing it to the given number of points),
and the <a href="qpolygon.html#putPoints">putPoints</a>() function
which copies a number of given points into the polygon from a
specified index (resizing the polygon if necessary).</p>
<p>QPolygon provides the <a href="qpolygon.html#boundingRect">boundingRect</a>() and <a href="qpolygon.html#translate">translate</a>() functions for geometry
functions. Use the <a href="qmatrix.html#map">QMatrix.map</a>()
function for more general transformations of QPolygons.</p>
<p>The QPolygon class is <a href="implicit-sharing.html#implicit-data-sharing">implicitly
shared</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QPolygon" />QPolygon.__init__ (<i>self</i>)</h3><p>Constructs a polygon with no points.</p>
<p><b>See also</b> <a href="qvector.html#isEmpty">QVector.isEmpty</a>().</p>
<h3 class="fn"><a name="QPolygon-2" />QPolygon.__init__ (<i>self</i>, <a href="qpolygon.html">QPolygon</a> <i>a</i>)</h3><p>Constructs a polygon of the given <i>size</i>. Creates an empty
polygon if <i>size</i> == 0.</p>
<p><b>See also</b> <a href="qvector.html#isEmpty">QVector.isEmpty</a>().</p>
<h3 class="fn"><a name="QPolygon-3" />QPolygon.__init__ (<i>self</i>, list-of-QPoint <i>v</i>)</h3><p>Constructs a copy of the given <i>polygon</i>.</p>
<p><b>See also</b> <a href="qpolygon.html#setPoints">setPoints</a>().</p>
<h3 class="fn"><a name="QPolygon-4" />QPolygon.__init__ (<i>self</i>, <a href="qrect.html">QRect</a> <i>rectangle</i>, bool <i>closed</i> = False)</h3><p>Constructs a polygon containing the specified <i>points</i>.</p>
<p><b>See also</b> <a href="qpolygon.html#setPoints">setPoints</a>().</p>
<h3 class="fn"><a name="QPolygon-5" />QPolygon.__init__ (<i>self</i>, int <i>asize</i>)</h3><p>Constructs a polygon from the given <i>rectangle</i>. If
<i>closed</i> is false, the polygon just contains the four points
of the rectangle ordered clockwise, otherwise the polygon's fifth
point is set to <i>rectangle</i>.topLeft().</p>
<p>Note that the bottom-right corner of the rectangle is located at
(rectangle.x() + rectangle.width(), rectangle.y() +
rectangle.height()).</p>
<p><b>See also</b> <a href="qpolygon.html#setPoints">setPoints</a>().</p>
<h3 class="fn"><a name="QPolygon-6" />QPolygon.__init__ (<i>self</i>, list-of-int <i>points</i>)</h3><h3 class="fn"><a name="QPolygon-7" />QPolygon.__init__ (<i>self</i>, QVariant <i>variant</i>)</h3><h3 class="fn"><a name="append" />QPolygon.append (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>value</i>)</h3><h3 class="fn"><a name="at" /><a href="qpoint.html">QPoint</a> QPolygon.at (<i>self</i>, int <i>i</i>)</h3><h3 class="fn"><a name="boundingRect" /><a href="qrect.html">QRect</a> QPolygon.boundingRect (<i>self</i>)</h3><p>Returns the bounding rectangle of the polygon, or <a href="qrect.html">QRect</a>(0, 0, 0, 0) if the polygon is empty.</p>
<p><b>See also</b> <a href="qvector.html#isEmpty">QVector.isEmpty</a>().</p>
<h3 class="fn"><a name="clear" />QPolygon.clear (<i>self</i>)</h3><h3 class="fn"><a name="contains" />bool QPolygon.contains (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>value</i>)</h3><h3 class="fn"><a name="containsPoint" />bool QPolygon.containsPoint (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>pt</i>, <a href="qt.html#FillRule-enum">Qt.FillRule</a> <i>fillRule</i>)</h3><p>Returns true if the given <i>point</i> is inside the polygon
according to the specified <i>fillRule</i>; otherwise returns
false.</p>
<p>This function was introduced in Qt 4.3.</p>
<h3 class="fn"><a name="count" />int QPolygon.count (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>value</i>)</h3><h3 class="fn"><a name="count-2" />int QPolygon.count (<i>self</i>)</h3><h3 class="fn"><a name="data" />sip.voidptr QPolygon.data (<i>self</i>)</h3><h3 class="fn"><a name="fill" />QPolygon.fill (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>value</i>, int <i>size</i> = -1)</h3><h3 class="fn"><a name="first" /><a href="qpoint.html">QPoint</a> QPolygon.first (<i>self</i>)</h3><h3 class="fn"><a name="indexOf" />int QPolygon.indexOf (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>value</i>, int <i>from</i> = 0)</h3><h3 class="fn"><a name="insert" />QPolygon.insert (<i>self</i>, int <i>i</i>, <a href="qpoint.html">QPoint</a> <i>value</i>)</h3><h3 class="fn"><a name="intersected" /><a href="qpolygon.html">QPolygon</a> QPolygon.intersected (<i>self</i>, <a href="qpolygon.html">QPolygon</a> <i>r</i>)</h3><p>Returns a polygon which is the intersection of this polygon and
<i>r</i>.</p>
<p>Set operations on polygons will treat the polygons as areas.
Non-closed polygons will be treated as implicitly closed.</p>
<p>This function was introduced in Qt 4.3.</p>
<h3 class="fn"><a name="isEmpty" />bool QPolygon.isEmpty (<i>self</i>)</h3><h3 class="fn"><a name="last" /><a href="qpoint.html">QPoint</a> QPolygon.last (<i>self</i>)</h3><h3 class="fn"><a name="lastIndexOf" />int QPolygon.lastIndexOf (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>value</i>, int <i>from</i> = -1)</h3><h3 class="fn"><a name="mid" /><a href="qpolygon.html">QPolygon</a> QPolygon.mid (<i>self</i>, int <i>pos</i>, int <i>length</i> = -1)</h3><h3 class="fn"><a name="point" /><a href="qpoint.html">QPoint</a> QPolygon.point (<i>self</i>, int <i>index</i>)</h3><p>Extracts the coordinates of the point at the given <i>index</i>
to *<i>x</i> and *<i>y</i> (if they are valid pointers).</p>
<p><b>See also</b> <a href="qpolygon.html#setPoint">setPoint</a>().</p>
<h3 class="fn"><a name="prepend" />QPolygon.prepend (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>value</i>)</h3><h3 class="fn"><a name="putPoints" />QPolygon.putPoints (<i>self</i>, int <i>index</i>, int <i>firstx</i>, int <i>firsty</i>, ...)</h3><p>Copies <i>nPoints</i> points from the variable argument list
into this polygon from the given <i>index</i>.</p>
<p>The points are given as a sequence of integers, starting with
<i>firstx</i> then <i>firsty</i>, and so on. The polygon is resized
if <tt>index+nPoints</tt> exceeds its current size.</p>
<p>The example code creates a polygon with three points (4,5),
(6,7) and (8,9), by expanding the polygon from 1 to 3 points:</p>
<pre class="cpp">
<span class="type"><a href="qpolygon.html">QPolygon</a></span> polygon(<span class="number">1</span>);
polygon<span class="operator">[</span><span class="number">0</span><span class="operator">]</span> <span class="operator">=</span> <span class="type"><a href="qpoint.html">QPoint</a></span>(<span class="number">4</span><span class="operator">,</span> <span class="number">5</span>);
polygon<span class="operator">.</span>putPoints(<span class="number">1</span><span class="operator">,</span> <span class="number">2</span><span class="operator">,</span> <span class="number">6</span><span class="operator">,</span><span class="number">7</span><span class="operator">,</span> <span class="number">8</span><span class="operator">,</span><span class="number">9</span>);
</pre>
<p>The following code has the same result, but here the putPoints()
function overwrites rather than extends:</p>
<pre class="cpp">
<span class="type"><a href="qpolygon.html">QPolygon</a></span> polygon(<span class="number">3</span>);
polygon<span class="operator">.</span>putPoints(<span class="number">0</span><span class="operator">,</span> <span class="number">3</span><span class="operator">,</span> <span class="number">4</span><span class="operator">,</span><span class="number">5</span><span class="operator">,</span> <span class="number">0</span><span class="operator">,</span><span class="number">0</span><span class="operator">,</span> <span class="number">8</span><span class="operator">,</span><span class="number">9</span>);
polygon<span class="operator">.</span>putPoints(<span class="number">1</span><span class="operator">,</span> <span class="number">1</span><span class="operator">,</span> <span class="number">6</span><span class="operator">,</span><span class="number">7</span>);
</pre>
<p><b>See also</b> <a href="qpolygon.html#setPoints">setPoints</a>().</p>
<h3 class="fn"><a name="putPoints-2" />QPolygon.putPoints (<i>self</i>, int <i>index</i>, int <i>nPoints</i>, <a href="qpolygon.html">QPolygon</a> <i>fromPolygon</i>, int <i>from</i> = 0)</h3><h3 class="fn"><a name="remove" />QPolygon.remove (<i>self</i>, int <i>i</i>)</h3><h3 class="fn"><a name="remove-2" />QPolygon.remove (<i>self</i>, int <i>i</i>, int <i>count</i>)</h3><h3 class="fn"><a name="replace" />QPolygon.replace (<i>self</i>, int <i>i</i>, <a href="qpoint.html">QPoint</a> <i>value</i>)</h3><h3 class="fn"><a name="setPoint" />QPolygon.setPoint (<i>self</i>, int <i>index</i>, <a href="qpoint.html">QPoint</a> <i>pt</i>)</h3><p>Sets the point at the given <i>index</i> to the point specified
by (<i>x</i>, <i>y</i>).</p>
<p><b>See also</b> <a href="qpolygon.html#point">point</a>(),
<a href="qpolygon.html#putPoints">putPoints</a>(), and <a href="qpolygon.html#setPoints">setPoints</a>().</p>
<h3 class="fn"><a name="setPoint-2" />QPolygon.setPoint (<i>self</i>, int <i>index</i>, int <i>x</i>, int <i>y</i>)</h3><p>This is an overloaded function.</p>
<p>Sets the point at the given <i>index</i> to the given
<i>point</i>.</p>
<h3 class="fn"><a name="setPoints" />QPolygon.setPoints (<i>self</i>, list-of-int <i>points</i>)</h3><p>Resizes the polygon to <i>nPoints</i> and populates it with the
given <i>points</i>.</p>
<p>The example code creates a polygon with two points (10, 20) and
(30, 40):</p>
<pre class="cpp">
<span class="keyword">static</span> <span class="keyword">const</span> <span class="type">int</span> points<span class="operator">[</span><span class="operator">]</span> <span class="operator">=</span> { <span class="number">10</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">30</span><span class="operator">,</span> <span class="number">40</span> };
<span class="type"><a href="qpolygon.html">QPolygon</a></span> polygon;
polygon<span class="operator">.</span>setPoints(<span class="number">2</span><span class="operator">,</span> points);
</pre>
<p><b>See also</b> <a href="qpolygon.html#setPoint">setPoint</a>()
and <a href="qpolygon.html#putPoints">putPoints</a>().</p>
<h3 class="fn"><a name="setPoints-2" />QPolygon.setPoints (<i>self</i>, int <i>firstx</i>, int <i>firsty</i>, ...)</h3><p>This is an overloaded function.</p>
<p>Resizes the polygon to <i>nPoints</i> and populates it with the
points specified by the variable argument list. The points are
given as a sequence of integers, starting with <i>firstx</i> then
<i>firsty</i>, and so on.</p>
<p>The example code creates a polygon with two points (10, 20) and
(30, 40):</p>
<pre class="cpp">
<span class="type"><a href="qpolygon.html">QPolygon</a></span> polygon;
polygon<span class="operator">.</span>setPoints(<span class="number">2</span><span class="operator">,</span> <span class="number">10</span><span class="operator">,</span> <span class="number">20</span><span class="operator">,</span> <span class="number">30</span><span class="operator">,</span> <span class="number">40</span>);
</pre>
<h3 class="fn"><a name="size" />int QPolygon.size (<i>self</i>)</h3><h3 class="fn"><a name="subtracted" /><a href="qpolygon.html">QPolygon</a> QPolygon.subtracted (<i>self</i>, <a href="qpolygon.html">QPolygon</a> <i>r</i>)</h3><p>Returns a polygon which is <i>r</i> subtracted from this
polygon.</p>
<p>Set operations on polygons will treat the polygons as areas.
Non-closed polygons will be treated as implicitly closed.</p>
<p>This function was introduced in Qt 4.3.</p>
<h3 class="fn"><a name="swap" />QPolygon.swap (<i>self</i>, <a href="qpolygon.html">QPolygon</a> <i>other</i>)</h3><p>Swaps polygon <i>other</i> with this polygon. This operation is
very fast and never fails.</p>
<p>This function was introduced in Qt 4.8.</p>
<h3 class="fn"><a name="translate" />QPolygon.translate (<i>self</i>, int <i>dx</i>, int <i>dy</i>)</h3><p>Translates all points in the polygon by (<i>dx</i>,
<i>dy</i>).</p>
<p><b>See also</b> <a href="qpolygon.html#translated">translated</a>().</p>
<h3 class="fn"><a name="translate-2" />QPolygon.translate (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>offset</i>)</h3><p>This is an overloaded function.</p>
<p>Translates all points in the polygon by the given
<i>offset</i>.</p>
<p><b>See also</b> <a href="qpolygon.html#translated">translated</a>().</p>
<h3 class="fn"><a name="translated" /><a href="qpolygon.html">QPolygon</a> QPolygon.translated (<i>self</i>, int <i>dx</i>, int <i>dy</i>)</h3><p>Returns a copy of the polygon that is translated by (<i>dx</i>,
<i>dy</i>).</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qpolygon.html#translate">translate</a>().</p>
<h3 class="fn"><a name="translated-2" /><a href="qpolygon.html">QPolygon</a> QPolygon.translated (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>offset</i>)</h3><p>This is an overloaded function.</p>
<p>Returns a copy of the polygon that is translated by the given
<i>offset</i>.</p>
<p>This function was introduced in Qt 4.6.</p>
<p><b>See also</b> <a href="qpolygon.html#translate">translate</a>().</p>
<h3 class="fn"><a name="united" /><a href="qpolygon.html">QPolygon</a> QPolygon.united (<i>self</i>, <a href="qpolygon.html">QPolygon</a> <i>r</i>)</h3><p>Returns a polygon which is the union of this polygon and
<i>r</i>.</p>
<p>Set operations on polygons, will treat the polygons as areas,
and implicitly close the polygon.</p>
<p>This function was introduced in Qt 4.3.</p>
<p><b>See also</b> <a href="qpolygon.html#intersected">intersected</a>() and <a href="qpolygon.html#subtracted">subtracted</a>().</p>
<h3 class="fn"><a name="value" /><a href="qpoint.html">QPoint</a> QPolygon.value (<i>self</i>, int <i>i</i>)</h3><h3 class="fn"><a name="value-2" /><a href="qpoint.html">QPoint</a> QPolygon.value (<i>self</i>, int <i>i</i>, <a href="qpoint.html">QPoint</a> <i>defaultValue</i>)</h3><h3 class="fn"><a name="__add__" /><a href="qpolygon.html">QPolygon</a> QPolygon.__add__ (<i>self</i>, <a href="qpolygon.html">QPolygon</a> <i>other</i>)</h3><h3 class="fn"><a name="__contains__" />int QPolygon.__contains__ (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>value</i>)</h3><h3 class="fn"><a name="__delitem__" />QPolygon.__delitem__ (<i>self</i>, int <i>i</i>)</h3><h3 class="fn"><a name="__delitem__-2" />QPolygon.__delitem__ (<i>self</i>, slice <i>slice</i>)</h3><h3 class="fn"><a name="__eq__" />bool QPolygon.__eq__ (<i>self</i>, <a href="qpolygon.html">QPolygon</a> <i>other</i>)</h3><h3 class="fn"><a name="__getitem__" /><a href="qpoint.html">QPoint</a> QPolygon.__getitem__ (<i>self</i>, int <i>i</i>)</h3><h3 class="fn"><a name="__getitem__-2" /><a href="qpolygon.html">QPolygon</a> QPolygon.__getitem__ (<i>self</i>, slice <i>slice</i>)</h3><h3 class="fn"><a name="__iadd__" /><a href="qpolygon.html">QPolygon</a> QPolygon.__iadd__ (<i>self</i>, <a href="qpolygon.html">QPolygon</a> <i>other</i>)</h3><h3 class="fn"><a name="__iadd__-2" /><a href="qpolygon.html">QPolygon</a> QPolygon.__iadd__ (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>value</i>)</h3><h3 class="fn"><a name="__len__" /> QPolygon.__len__ (<i>self</i>)</h3><h3 class="fn"><a name="__lshift__" />object QPolygon.__lshift__ (<i>self</i>, <a href="qpoint.html">QPoint</a> <i>value</i>)</h3><h3 class="fn"><a name="__mul__" /><a href="qpolygon.html">QPolygon</a> QPolygon.__mul__ (<i>self</i>, <a href="qmatrix.html">QMatrix</a> <i>m</i>)</h3><h3 class="fn"><a name="__mul__-2" /><a href="qpolygon.html">QPolygon</a> QPolygon.__mul__ (<i>self</i>, <a href="qtransform.html">QTransform</a> <i>m</i>)</h3><h3 class="fn"><a name="__ne__" />bool QPolygon.__ne__ (<i>self</i>, <a href="qpolygon.html">QPolygon</a> <i>other</i>)</h3><h3 class="fn"><a name="__setitem__" />QPolygon.__setitem__ (<i>self</i>, int <i>i</i>, <a href="qpoint.html">QPoint</a> <i>value</i>)</h3><h3 class="fn"><a name="__setitem__-2" />QPolygon.__setitem__ (<i>self</i>, slice <i>slice</i>, <a href="qpolygon.html">QPolygon</a> <i>list</i>)</h3><address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.11.2 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://qt.digia.com">Digia</a> 2014</td><td align="right" width="25%">Qt 4.8.6</td></tr></table></div></address></body></html>
|