7#include <QtGui/qtguiglobal.h>
8#include <QtCore/qlist.h>
9#include <QtCore/qpoint.h>
10#include <QtCore/qrect.h>
31 void swap(
QPolygon &other)
noexcept { QList<QPoint>::swap(other); }
35 Q_GUI_EXPORT
void translate(
int dx,
int dy);
43 Q_GUI_EXPORT
void point(
int i,
int *x,
int *y)
const;
45 Q_GUI_EXPORT
void setPoint(
int index,
int x,
int y);
46 inline void setPoint(
int index,
const QPoint &p);
47 Q_GUI_EXPORT
void setPoints(
int nPoints,
const int *points);
48 Q_GUI_EXPORT
void setPoints(
int nPoints,
int firstx,
int firsty, ...);
49 Q_GUI_EXPORT
void putPoints(
int index,
int nPoints,
const int *points);
50 Q_GUI_EXPORT
void putPoints(
int index,
int nPoints,
int firstx,
int firsty, ...);
51 Q_GUI_EXPORT
void putPoints(
int index,
int nPoints,
const QPolygon & from,
int fromIndex=0);
53 Q_GUI_EXPORT
bool containsPoint(
const QPoint &pt, Qt::FillRule fillRule)
const;
63Q_DECLARE_SHARED(QPolygon)
65#ifndef QT_NO_DEBUG_STREAM
66Q_GUI_EXPORT
QDebug operator<<(QDebug,
const QPolygon &);
70
71
72#ifndef QT_NO_DATASTREAM
73Q_GUI_EXPORT
QDataStream &operator<<(QDataStream &stream,
const QPolygon &polygon);
74Q_GUI_EXPORT
QDataStream &operator>>(QDataStream &stream, QPolygon &polygon);
78
79
91{
return translated(offset.x(), offset.y()); }
108 inline void translate(qreal dx, qreal dy);
116 bool isClosed()
const {
return !isEmpty() && first() == last(); }
120 Q_GUI_EXPORT
bool containsPoint(
const QPointF &pt, Qt::FillRule fillRule)
const;
128Q_DECLARE_SHARED(QPolygonF)
132#ifndef QT_NO_DEBUG_STREAM
133Q_GUI_EXPORT
QDebug operator<<(QDebug,
const QPolygonF &);
137
138
139#ifndef QT_NO_DATASTREAM
140Q_GUI_EXPORT
QDataStream &operator<<(QDataStream &stream,
const QPolygonF &array);
141Q_GUI_EXPORT
QDataStream &operator>>(QDataStream &stream, QPolygonF &array);
145{ translate(QPointF(dx, dy)); }
148{
return translated(QPointF(dx, dy)); }
\inmodule QtCore\reentrant
void updateOpacity(qreal opacity)
void drawImage(const QRectF &r, const QImage &image, const QRectF &sr, Qt::ImageConversionFlags flags=Qt::AutoColor) override
Reimplement this function to draw the part of the image specified by the sr rectangle in the given re...
void updateMatrix(const QTransform &matrix)
void updatePen(const QPen &pen)
void drawPolygon(const QPointF *points, int numPoints, PolygonDrawMode mode) override
Reimplement this virtual function to draw the polygon defined by the pointCount first points in point...
void updateClipRegion(const QRegion ®ion, Qt::ClipOperation op)
void drawPath(const QPainterPath &path) override
The default implementation ignores the path and does nothing.
void drawTextItem(const QPointF &p, const QTextItem &ti) override
This function draws the text item textItem at position p.
QPicturePaintEngine(QPaintEnginePrivate &dptr)
void updateBrushOrigin(const QPointF &origin)
void updateFont(const QFont &font)
void updateCompositionMode(QPainter::CompositionMode cmode)
void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override
Reimplement this function to draw the pixmap in the given rect, starting at the given p.
void updateClipEnabled(bool enabled)
void updateState(const QPaintEngineState &state) override
Reimplement this function to update the state of a paint engine.
bool end() override
Reimplement this function to finish painting on the current paint device.
void updateBrush(const QBrush &brush)
void drawEllipse(const QRectF &rect) override
Reimplement this function to draw the largest ellipse that can be contained within rectangle rect.
void updateClipPath(const QPainterPath &path, Qt::ClipOperation op)
void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override
Reimplement this function to draw the part of the pm specified by the sr rectangle in the given r.
void updateRenderHints(QPainter::RenderHints hints)
void updateBackground(Qt::BGMode bgmode, const QBrush &bgBrush)
Type type() const override
Reimplement this function to return the paint engine \l{Type}.
bool begin(QPaintDevice *pdev) override
Reimplement this function to initialise your paint engine when painting is to start on the paint devi...
The QPicture class is a paint device that records and replays QPainter commands.
The QPolygonF class provides a list of points using floating point precision.
void swap(QPolygonF &other)
Q_GUI_EXPORT bool containsPoint(const QPointF &pt, Qt::FillRule fillRule) const
Q_GUI_EXPORT bool intersects(const QPolygonF &r) const
void translate(qreal dx, qreal dy)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QPolygonF()=default
Constructs a polygon with no points.
QPolygonF translated(qreal dx, qreal dy) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isClosed() const
Returns true if the polygon is closed; otherwise returns false.
The QPolygon class provides a list of points using integer precision.
QPolygonF toPolygonF() const
Q_GUI_EXPORT bool intersects(const QPolygon &r) const
Q_GUI_EXPORT void putPoints(int index, int nPoints, int firstx, int firsty,...)
Copies nPoints points from the variable argument list into this polygon from the given index.
Q_GUI_EXPORT void translate(int dx, int dy)
Translates all points in the polygon by ({dx}, {dy}).
Q_GUI_EXPORT void putPoints(int index, int nPoints, const QPolygon &from, int fromIndex=0)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QPoint point(int i) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Q_GUI_EXPORT void setPoints(int nPoints, int firstx, int firsty,...)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void swap(QPolygon &other) noexcept
QPolygon()=default
Constructs a polygon with no points.
Q_GUI_EXPORT bool containsPoint(const QPoint &pt, Qt::FillRule fillRule) const
Q_GUI_EXPORT void putPoints(int index, int nPoints, const int *points)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setPoint(int index, const QPoint &p)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Q_GUI_EXPORT void setPoint(int index, int x, int y)
Sets the point at the given index to the point specified by ({x}, {y}).
QPolygon translated(const QPoint &offset) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
void translate(const QPoint &offset)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Q_GUI_EXPORT 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)...
Q_GUI_EXPORT void setPoints(int nPoints, const int *points)
Resizes the polygon to nPoints and populates it with the given points.
Combined button and popup list for selecting options.
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)