45 #include <QtCore/qvector.h> 46 #include <QtCore/qpoint.h> 47 #include <QtCore/qrect.h> 69 QPolygon(
int nPoints,
const int *points);
74 void translate(
int dx,
int dy);
75 void translate(
const QPoint &offset);
77 QPolygon translated(
int dx,
int dy)
const;
82 void point(
int i,
int *x,
int *y)
const;
84 void setPoint(
int index,
int x,
int y);
85 void setPoint(
int index,
const QPoint &p);
86 void setPoints(
int nPoints,
const int *points);
87 void setPoints(
int nPoints,
int firstx,
int firsty, ...);
88 void putPoints(
int index,
int nPoints,
const int *points);
89 void putPoints(
int index,
int nPoints,
int firstx,
int firsty, ...);
90 void putPoints(
int index,
int nPoints,
const QPolygon & from,
int fromIndex=0);
101 #ifndef QT_NO_DEBUG_STREAM 108 #ifndef QT_NO_DATASTREAM 118 { (*this)[
index] = pt; }
124 {
return at(index); }
167 #ifndef QT_NO_DEBUG_STREAM 174 #ifndef QT_NO_DATASTREAM The QVariant class acts like a union for the most common Qt data types.
The QDebug class provides an output stream for debugging information.
QPolygon united(const QPolygon &r) const
Returns a polygon which is the union of this polygon and r.
QDataStream & operator<<(QDataStream &stream, const QPolygonF &polygon)
Writes the given polygon to the given stream, and returns a reference to the stream.
QDataStream & operator>>(QDataStream &stream, QPolygon &polygon)
Reads a polygon from the given stream into the given polygon, and returns a reference to the stream...
#define QT_END_NAMESPACE
This macro expands to.
~QPolygon()
Destroys the polygon.
QDataStream & operator<<(QDataStream &stream, const QPolygon &polygon)
Writes the given polygon to the given stream, and returns a reference to the stream.
QPolygonF(const QPolygonF &a)
Constructs a copy of the given polygon.
QPolygon translated(int dx, int dy) const
Returns a copy of the polygon that is translated by ({dx}, {dy}).
The QMatrix class specifies 2D transformations of a coordinate system.
QPoint & first()
Returns a reference to the first item in the vector.
The QPointF class defines a point in the plane using floating point precision.
QPolygon()
Constructs a polygon with no points.
long ASN1_INTEGER_get ASN1_INTEGER * a
QPolygonF()
Constructs a polygon with no points.
The QPolygon class provides a vector of points using integer precision.
void swap(QVector< T > &other)
Swaps vector other with this vector.
The QVector class is a template class that provides a dynamic array.
QPolygon(const QVector< QPoint > &v)
Constructs a polygon containing the specified points.
QDataStream & operator>>(QDataStream &stream, QPolygonF &polygon)
Reads a polygon from the given stream into the given polygon, and returns a reference to the stream...
~QPolygonF()
Destroys the polygon.
static const QRectF boundingRect(const QPointF *points, int pointCount)
QPolygonF translated(qreal dx, qreal dy) const
Returns a copy of the polygon that is translated by ({dx}, {dy}).
void translate(int dx, int dy)
Translates all points in the polygon by ({dx}, {dy}).
#define QT_BEGIN_NAMESPACE
This macro expands to.
The QRectF class defines a rectangle in the plane using floating point precision. ...
QPolygon subtracted(const QPolygon &r) const
Returns a polygon which is r subtracted from this polygon.
QPolygonF(const QVector< QPointF > &v)
Constructs a polygon containing the specified points.
The QPolygonF class provides a vector of points using floating point precision.
void translate(qreal dx, qreal dy)
Translates all points in the polygon by ({dx}, {dy}).
const QPoint & at(int i) const
Returns the item at index position i in the vector.
QPolygon(const QPolygon &a)
Constructs a copy of the given polygon.
void swap(QPolygonF &other)
Swaps polygon other with this polygon.
The QPoint class defines a point in the plane using integer precision.
QPoint & last()
Returns a reference to the last item in the vector.
void swap(QPolygon &other)
Swaps polygon other with this polygon.
The QRect class defines a rectangle in the plane using integer precision.
void setPoint(int index, int x, int y)
Sets the point at the given index to the point specified by ({x}, {y}).
QRect boundingRect() const
Returns the bounding rectangle of the polygon, or QRect(0, 0, 0, 0) if the polygon is empty...
bool containsPoint(const QPoint &pt, Qt::FillRule fillRule) const
Returns true if the given point is inside the polygon according to the specified fillRule; otherwise ...
int y() const
Returns the y coordinate of this point.
bool isEmpty() const
Returns true if the vector has size 0; otherwise returns false.
The QDataStream class provides serialization of binary data to a QIODevice.
bool isClosed() const
Returns true if the polygon is closed; otherwise returns false.
int x() const
Returns the x coordinate of this point.
int size() const
Returns the number of items in the vector.
void point(int i, int *x, int *y) const
Extracts the coordinates of the point at the given index to {x} and *{y} (if they are valid pointers)...
QPolygon intersected(const QPolygon &r) const
Returns a polygon which is the intersection of this polygon and r.