qpointarray.html
来自「QT 下载资料仅供参考」· HTML 代码 · 共 284 行 · 第 1/2 页
HTML
284 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/src/kernel/qpointarray.cpp:47 --><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>QPointArray Class</title><style type="text/css"><!--h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }a:link { color: #004faf; text-decoration: none }a:visited { color: #672967; text-decoration: none }body { background: #ffffff; color: black; }--></style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr bgcolor="#E5E5E5"><td 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="mainclasses.html"><font color="#004faf">Main Classes</font></a> | <a href="annotated.html"><font color="#004faf">Annotated</font></a> | <a href="groups.html"><font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"><font color="#004faf">Functions</font></a></td><td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QPointArray Class Reference</h1><p>The QPointArray class provides an array of points.<a href="#details">More...</a><p><tt>#include <<a href="qpointarray-h.html">qpointarray.h</a>></tt><p>Inherits <a href="qmemarray.html">QMemArray</a><QPoint>.<p><a href="qpointarray-members.html">List of all member functions.</a><h2>Public Members</h2><ul><li><div class=fn><a href="#QPointArray"><b>QPointArray</b></a> ()</div></li><li><div class=fn><a href="#~QPointArray"><b>~QPointArray</b></a> ()</div></li><li><div class=fn><a href="#QPointArray-2"><b>QPointArray</b></a> ( int size )</div></li><li><div class=fn><a href="#QPointArray-3"><b>QPointArray</b></a> ( const QPointArray & a )</div></li><li><div class=fn><a href="#QPointArray-4"><b>QPointArray</b></a> ( const QRect & r, bool closed = FALSE )</div></li><li><div class=fn>QPointArray & <a href="#operator-eq"><b>operator=</b></a> ( const QPointArray & a )</div></li><li><div class=fn>QPointArray <a href="#copy"><b>copy</b></a> () const</div></li><li><div class=fn>void <a href="#translate"><b>translate</b></a> ( int dx, int dy )</div></li><li><div class=fn>QRect <a href="#boundingRect"><b>boundingRect</b></a> () const</div></li><li><div class=fn>void <a href="#point"><b>point</b></a> ( uint index, int * x, int * y ) const</div></li><li><div class=fn>QPoint <a href="#point-2"><b>point</b></a> ( uint index ) const</div></li><li><div class=fn>void <a href="#setPoint"><b>setPoint</b></a> ( uint index, int x, int y )</div></li><li><div class=fn>void <a href="#setPoint-2"><b>setPoint</b></a> ( uint i, const QPoint & p )</div></li><li><div class=fn>bool <a href="#putPoints"><b>putPoints</b></a> ( int index, int nPoints, int firstx, int firsty, ... )</div></li><li><div class=fn>bool <a href="#putPoints-3"><b>putPoints</b></a> ( int index, int nPoints, const QPointArray & from, int fromIndex = 0 )</div></li><li><div class=fn>void <a href="#makeArc"><b>makeArc</b></a> ( int x, int y, int w, int h, int a1, int a2 )</div></li><li><div class=fn>void <a href="#makeEllipse"><b>makeEllipse</b></a> ( int x, int y, int w, int h )</div></li><li><div class=fn>void <a href="#makeArc-2"><b>makeArc</b></a> ( int x, int y, int w, int h, int a1, int a2, const QWMatrix & xf )</div></li><li><div class=fn>QPointArray <a href="#cubicBezier"><b>cubicBezier</b></a> () const</div></li></ul><h2>Related Functions</h2><ul><li><div class=fn>QDataStream & <a href="#operator-lt-lt"><b>operator<<</b></a> ( QDataStream & s, const QPointArray & a )</div></li><li><div class=fn>QDataStream & <a href="#operator-gt-gt"><b>operator>></b></a> ( QDataStream & s, QPointArray & a )</div></li></ul><hr><a name="details"></a><h2>Detailed Description</h2>The QPointArray class provides an array of points.<p> <p> A QPointArray is an array of <a href="qpoint.html">QPoint</a> objects. In addition to thefunctions provided by <a href="qmemarray.html">QMemArray</a>, QPointArray provides somepoint-specific functions.<p> For convenient reading and writing of the point data usesetPoints(), <a href="#putPoints">putPoints</a>(), <a href="#point">point</a>(), and <a href="#setPoint">setPoint</a>().<p> For geometry operations: <a href="#boundingRect">boundingRect</a>() and <a href="#translate">translate</a>(). There isalso a <a href="qwmatrix.html#map">QWMatrix::map</a>() function for more general transformation ofQPointArrays. You can also create arcs and ellipses with <a href="#makeArc">makeArc</a>()and <a href="#makeEllipse">makeEllipse</a>().<p> Among others, QPointArray is used by <a href="qpainter.html#drawLineSegments">QPainter::drawLineSegments</a>(),<a href="qpainter.html#drawPolyline">QPainter::drawPolyline</a>(), <a href="qpainter.html#drawPolygon">QPainter::drawPolygon</a>() and<a href="qpainter.html#drawCubicBezier">QPainter::drawCubicBezier</a>().<p> Note that because this class is a QMemArray, copying an array andmodifying the copy modifies the original as well, i.e. a <a href="shclass.html#shallow-copy">shallow copy</a>. If you need a <a href="shclass.html#deep-copy">deep copy</a> use <a href="#copy">copy</a>() or <a href="qmemarray.html#detach">detach</a>(), for example:<p> <pre> void drawGiraffe( const QPointArray & r, QPainter * p ) { QPointArray tmp = r; tmp.<a href="qmemarray.html#detach">detach</a>(); // some code that modifies tmp p->drawPoints( tmp ); } </pre> <p> If you forget the tmp.detach(), the const array will be modified.<p> <p>See also <a href="qpainter.html">QPainter</a>, <a href="qwmatrix.html">QWMatrix</a>, <a href="qmemarray.html">QMemArray</a>, <a href="graphics.html">Graphics Classes</a>, <a href="images.html">Image Processing Classes</a> and <a href="shared.html">Implicitly and Explicitly Shared Classes</a>.<hr><h2>Member Function Documentation</h2><h3 class=fn><a name="QPointArray"></a>QPointArray::QPointArray ()</h3><p> Constructs a null point array.<p> <p>See also <a href="qmemarray.html#isNull">isNull</a>().<h3 class=fn><a name="QPointArray-2"></a>QPointArray::QPointArray ( int size )</h3><p> Constructs a point array with room for <em>size</em> points. Makes anull array if <em>size</em> == 0.<p> <p>See also <a href="qmemarray.html#resize">resize</a>() and <a href="qmemarray.html#isNull">isNull</a>().<h3 class=fn><a name="QPointArray-3"></a>QPointArray::QPointArray ( const <a href="qpointarray.html">QPointArray</a> & a )</h3><p> Constructs a <a href="shclass.html#shallow-copy">shallow copy</a> of the point array <em>a</em>.<p> <p>See also <a href="#copy">copy</a>().<h3 class=fn><a name="QPointArray-4"></a>QPointArray::QPointArray ( const <a href="qrect.html">QRect</a> & r, bool closed = FALSE )</h3>Constructs a point array from the rectangle <em>r</em>.<p> If <em>closed</em> is FALSE, then the point array just contains thefollowing four points in the listed order: r.topLeft(),r.topRight(), r.bottomRight() and r.bottomLeft().<p> If <em>closed</em> is TRUE, then a fifth point is set to r.topLeft().<h3 class=fn><a name="~QPointArray"></a>QPointArray::~QPointArray ()</h3><p> Destroys the point array.<h3 class=fn><a href="qrect.html">QRect</a> <a name="boundingRect"></a>QPointArray::boundingRect () const</h3>Returns the bounding rectangle of the points in the array, or<a href="qrect.html">QRect</a>(0,0,0,0) if the array is empty.<h3 class=fn><a href="qpointarray.html">QPointArray</a> <a name="copy"></a>QPointArray::copy () const</h3><p> Creates a <a href="shclass.html#deep-copy">deep copy</a> of the array.
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?