Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 6170

qt-doc-4.8.5-10.fc18.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" />
<!-- qpolygon.cpp -->
  <title>Qt 4.8: QPolygon 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="qtgui.html">QtGui</a></li>
<li>QPolygon</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">QPolygon Class Reference</h1>
<!-- $$$QPolygon-brief -->
<p>The QPolygon class provides a vector of points using integer precision. <a href="#details">More...</a></p>
<!-- @@@QPolygon -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QPolygon&gt;</span></pre><p><b>Inherits: </b><a href="qvector.html">QVector&lt;QPoint&gt;</a>.</p>
<p><b>Inherited by: </b><a href="q3pointarray.html" class="compat">Q3PointArray</a>.</p>
<p><b>Note:</b> All functions in this class are <a href="threads-reentrancy.html#reentrant">reentrant</a>.</p>
<ul>
<li><a href="qpolygon-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="qpolygon.html#QPolygon">QPolygon</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#QPolygon-2">QPolygon</a></b> ( int <i>size</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#QPolygon-3">QPolygon</a></b> ( const QPolygon &amp; <i>polygon</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#QPolygon-4">QPolygon</a></b> ( const QVector&lt;QPoint&gt; &amp; <i>points</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#QPolygon-5">QPolygon</a></b> ( const QRect &amp; <i>rectangle</i>, bool <i>closed</i> = false )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#dtor.QPolygon">~QPolygon</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#boundingRect">boundingRect</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#containsPoint">containsPoint</a></b> ( const QPoint &amp; <i>point</i>, Qt::FillRule <i>fillRule</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygon </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#intersected">intersected</a></b> ( const QPolygon &amp; <i>r</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#point">point</a></b> ( int <i>index</i>, int * <i>x</i>, int * <i>y</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPoint </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#point-2">point</a></b> ( int <i>index</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#putPoints">putPoints</a></b> ( int <i>index</i>, int <i>nPoints</i>, int <i>firstx</i>, int <i>firsty</i>, ... )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#putPoints-3">putPoints</a></b> ( int <i>index</i>, int <i>nPoints</i>, const QPolygon &amp; <i>fromPolygon</i>, int <i>fromIndex</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#setPoint">setPoint</a></b> ( int <i>index</i>, int <i>x</i>, int <i>y</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#setPoint-2">setPoint</a></b> ( int <i>index</i>, const QPoint &amp; <i>point</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#setPoints">setPoints</a></b> ( int <i>nPoints</i>, const int * <i>points</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#setPoints-2">setPoints</a></b> ( int <i>nPoints</i>, int <i>firstx</i>, int <i>firsty</i>, ... )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygon </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#subtracted">subtracted</a></b> ( const QPolygon &amp; <i>r</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#swap">swap</a></b> ( QPolygon &amp; <i>other</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#translate">translate</a></b> ( int <i>dx</i>, int <i>dy</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#translate-2">translate</a></b> ( const QPoint &amp; <i>offset</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygon </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#translated">translated</a></b> ( int <i>dx</i>, int <i>dy</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygon </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#translated-2">translated</a></b> ( const QPoint &amp; <i>offset</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QPolygon </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#united">united</a></b> ( const QPolygon &amp; <i>r</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#operator-QVariant">operator QVariant</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">65 public functions inherited from <a href="qvector.html#public-functions">QVector</a></li>
</ul>
<a name="related-non-members"></a>
<h2>Related Non-Members</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#operator-lt-lt-29">operator&lt;&lt;</a></b> ( QDataStream &amp; <i>stream</i>, const QPolygon &amp; <i>polygon</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QDataStream &amp; </td><td class="memItemRight bottomAlign"><b><a href="qpolygon.html#operator-gt-gt-20">operator&gt;&gt;</a></b> ( QDataStream &amp; <i>stream</i>, QPolygon &amp; <i>polygon</i> )</td></tr>
</table>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">2 static public members inherited from <a href="qvector.html#static-public-members">QVector</a></li>
</ul>
<a name="details"></a>
<!-- $$$QPolygon-description -->
<div class="descr">
<h2>Detailed Description</h2>
<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>&lt;<a href="qpoint.html">QPoint</a>&gt;. 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">&lt;</span><span class="operator">&lt;</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">&lt;</span><span class="operator">&lt;</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>
</div>
<p><b>See also </b><a href="qvector.html">QVector</a>, <a href="qpolygonf.html">QPolygonF</a>, and <a href="qline.html">QLine</a>.</p>
<!-- @@@QPolygon -->
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QPolygon[overload1]$$$QPolygon -->
<h3 class="fn"><a name="QPolygon"></a>QPolygon::<span class="name">QPolygon</span> ()</h3>
<p>Constructs a polygon with no points.</p>
<p><b>See also </b><a href="qvector.html#isEmpty">QVector::isEmpty</a>().</p>
<!-- @@@QPolygon -->
<!-- $$$QPolygon$$$QPolygonint -->
<h3 class="fn"><a name="QPolygon-2"></a>QPolygon::<span class="name">QPolygon</span> ( <span class="type">int</span> <i>size</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>
<!-- @@@QPolygon -->
<!-- $$$QPolygon$$$QPolygonconstQPolygon& -->
<h3 class="fn"><a name="QPolygon-3"></a>QPolygon::<span class="name">QPolygon</span> ( const <span class="type">QPolygon</span> &amp; <i>polygon</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>
<!-- @@@QPolygon -->
<!-- $$$QPolygon$$$QPolygonconstQVector<QPoint>& -->
<h3 class="fn"><a name="QPolygon-4"></a>QPolygon::<span class="name">QPolygon</span> ( const <span class="type"><a href="qvector.html">QVector</a></span>&lt;<span class="type"><a href="qpoint.html">QPoint</a></span>&gt; &amp; <i>points</i> )</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>
<!-- @@@QPolygon -->
<!-- $$$QPolygon$$$QPolygonconstQRect&bool -->
<h3 class="fn"><a name="QPolygon-5"></a>QPolygon::<span class="name">QPolygon</span> ( const <span class="type"><a href="qrect.html">QRect</a></span> &amp; <i>rectangle</i>, <span class="type">bool</span> <i>closed</i> = false )</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>
<!-- @@@QPolygon -->
<!-- $$$~QPolygon[overload1]$$$~QPolygon -->
<h3 class="fn"><a name="dtor.QPolygon"></a>QPolygon::<span class="name">~QPolygon</span> ()</h3>
<p>Destroys the polygon.</p>
<!-- @@@~QPolygon -->
<!-- $$$boundingRect[overload1]$$$boundingRect -->
<h3 class="fn"><a name="boundingRect"></a><span class="type"><a href="qrect.html">QRect</a></span> QPolygon::<span class="name">boundingRect</span> () const</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>
<!-- @@@boundingRect -->
<!-- $$$containsPoint[overload1]$$$containsPointconstQPoint&Qt::FillRule -->
<h3 class="fn"><a name="containsPoint"></a><span class="type">bool</span> QPolygon::<span class="name">containsPoint</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>point</i>, <span class="type"><a href="qt.html#FillRule-enum">Qt::FillRule</a></span> <i>fillRule</i> ) const</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>
<!-- @@@containsPoint -->
<!-- $$$intersected[overload1]$$$intersectedconstQPolygon& -->
<h3 class="fn"><a name="intersected"></a><span class="type">QPolygon</span> QPolygon::<span class="name">intersected</span> ( const <span class="type">QPolygon</span> &amp; <i>r</i> ) const</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>
<!-- @@@intersected -->
<!-- $$$point[overload1]$$$pointintint*int* -->
<h3 class="fn"><a name="point"></a><span class="type">void</span> QPolygon::<span class="name">point</span> ( <span class="type">int</span> <i>index</i>, <span class="type">int</span> * <i>x</i>, <span class="type">int</span> * <i>y</i> ) const</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>
<!-- @@@point -->
<!-- $$$point$$$pointint -->
<h3 class="fn"><a name="point-2"></a><span class="type"><a href="qpoint.html">QPoint</a></span> QPolygon::<span class="name">point</span> ( <span class="type">int</span> <i>index</i> ) const</h3>
<p>This is an overloaded function.</p>
<p>Returns the point at the given <i>index</i>.</p>
<!-- @@@point -->
<!-- $$$putPoints[overload1]$$$putPointsintintintint... -->
<h3 class="fn"><a name="putPoints"></a><span class="type">void</span> QPolygon::<span class="name">putPoints</span> ( <span class="type">int</span> <i>index</i>, <span class="type">int</span> <i>nPoints</i>, <span class="type">int</span> <i>firstx</i>, <span class="type">int</span> <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>
<!-- @@@putPoints -->
<!-- $$$putPoints$$$putPointsintintconstQPolygon&int -->
<h3 class="fn"><a name="putPoints-3"></a><span class="type">void</span> QPolygon::<span class="name">putPoints</span> ( <span class="type">int</span> <i>index</i>, <span class="type">int</span> <i>nPoints</i>, const <span class="type">QPolygon</span> &amp; <i>fromPolygon</i>, <span class="type">int</span> <i>fromIndex</i> = 0 )</h3>
<p>This is an overloaded function.</p>
<p>Copies <i>nPoints</i> points from the given <i>fromIndex</i> ( 0 by default) in <i>fromPolygon</i> into this polygon, starting at the specified <i>index</i>. For example:</p>
<pre class="cpp">         <span class="type"><a href="qpolygon.html">QPolygon</a></span> polygon1;
         polygon1<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">1</span><span class="operator">,</span><span class="number">2</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">5</span><span class="operator">,</span><span class="number">6</span>);
         <span class="comment">// polygon1 is now the three-point polygon(1,2, 0,0, 5,6);</span>

         <span class="type"><a href="qpolygon.html">QPolygon</a></span> polygon2;
         polygon2<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">4</span><span class="operator">,</span> <span class="number">5</span><span class="operator">,</span><span class="number">5</span><span class="operator">,</span> <span class="number">6</span><span class="operator">,</span><span class="number">6</span>);
         <span class="comment">// polygon2 is now (4,4, 5,5, 6,6);</span>

         polygon1<span class="operator">.</span>putPoints(<span class="number">2</span><span class="operator">,</span> <span class="number">3</span><span class="operator">,</span> polygon2);
         <span class="comment">// polygon1 is now the five-point polygon(1,2, 0,0, 4,4, 5,5, 6,6);</span></pre>
<!-- @@@putPoints -->
<!-- $$$setPoint[overload1]$$$setPointintintint -->
<h3 class="fn"><a name="setPoint"></a><span class="type">void</span> QPolygon::<span class="name">setPoint</span> ( <span class="type">int</span> <i>index</i>, <span class="type">int</span> <i>x</i>, <span class="type">int</span> <i>y</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>
<!-- @@@setPoint -->
<!-- $$$setPoint$$$setPointintconstQPoint& -->
<h3 class="fn"><a name="setPoint-2"></a><span class="type">void</span> QPolygon::<span class="name">setPoint</span> ( <span class="type">int</span> <i>index</i>, const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>point</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>
<!-- @@@setPoint -->
<!-- $$$setPoints[overload1]$$$setPointsintconstint* -->
<h3 class="fn"><a name="setPoints"></a><span class="type">void</span> QPolygon::<span class="name">setPoints</span> ( <span class="type">int</span> <i>nPoints</i>, const <span class="type">int</span> * <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>
<!-- @@@setPoints -->
<!-- $$$setPoints$$$setPointsintintint... -->
<h3 class="fn"><a name="setPoints-2"></a><span class="type">void</span> QPolygon::<span class="name">setPoints</span> ( <span class="type">int</span> <i>nPoints</i>, <span class="type">int</span> <i>firstx</i>, <span class="type">int</span> <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>
<!-- @@@setPoints -->
<!-- $$$subtracted[overload1]$$$subtractedconstQPolygon& -->
<h3 class="fn"><a name="subtracted"></a><span class="type">QPolygon</span> QPolygon::<span class="name">subtracted</span> ( const <span class="type">QPolygon</span> &amp; <i>r</i> ) const</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>
<!-- @@@subtracted -->
<!-- $$$swap[overload1]$$$swapQPolygon& -->
<h3 class="fn"><a name="swap"></a><span class="type">void</span> QPolygon::<span class="name">swap</span> ( <span class="type">QPolygon</span> &amp; <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>
<!-- @@@swap -->
<!-- $$$translate[overload1]$$$translateintint -->
<h3 class="fn"><a name="translate"></a><span class="type">void</span> QPolygon::<span class="name">translate</span> ( <span class="type">int</span> <i>dx</i>, <span class="type">int</span> <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>
<!-- @@@translate -->
<!-- $$$translate$$$translateconstQPoint& -->
<h3 class="fn"><a name="translate-2"></a><span class="type">void</span> QPolygon::<span class="name">translate</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <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>
<!-- @@@translate -->
<!-- $$$translated[overload1]$$$translatedintint -->
<h3 class="fn"><a name="translated"></a><span class="type">QPolygon</span> QPolygon::<span class="name">translated</span> ( <span class="type">int</span> <i>dx</i>, <span class="type">int</span> <i>dy</i> ) const</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>
<!-- @@@translated -->
<!-- $$$translated$$$translatedconstQPoint& -->
<h3 class="fn"><a name="translated-2"></a><span class="type">QPolygon</span> QPolygon::<span class="name">translated</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>offset</i> ) const</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>
<!-- @@@translated -->
<!-- $$$united[overload1]$$$unitedconstQPolygon& -->
<h3 class="fn"><a name="united"></a><span class="type">QPolygon</span> QPolygon::<span class="name">united</span> ( const <span class="type">QPolygon</span> &amp; <i>r</i> ) const</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>
<!-- @@@united -->
<!-- $$$operator QVariant[overload1]$$$operator QVariant -->
<h3 class="fn"><a name="operator-QVariant"></a>QPolygon::<span class="name">operator QVariant</span> () const</h3>
<p>Returns the polygon as a <a href="qvariant.html">QVariant</a></p>
<!-- @@@operator QVariant -->
</div>
<div class="relnonmem">
<h2>Related Non-Members</h2>
<!-- $$$operator<<$$$operator<<QDataStream&constQPolygon& -->
<h3 class="fn"><a name="operator-lt-lt-29"></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">QPolygon</span> &amp; <i>polygon</i> )</h3>
<p>Writes the given <i>polygon</i> to the given <i>stream</i>, and returns a reference to the stream.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="datastreamformat.html">Serializing Qt Data Types</a>.</p>
<!-- @@@operator<< -->
<!-- $$$operator>>$$$operator>>QDataStream&QPolygon& -->
<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">QPolygon</span> &amp; <i>polygon</i> )</h3>
<p>Reads a polygon from the given <i>stream</i> into the given <i>polygon</i>, and returns a reference to the stream.</p>
<p>This function was introduced in Qt 4.4.</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> 2013 Digia Plc and/or its
      subsidiaries. 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>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      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>