QPolygonF Class
The QPolygonF class is a list of points with real coordinates. More…
| Header | #include <QPolygonF> |
|---|---|
| CMake | target_link_libraries(app PRIVATE Nt::Gui) |
| Module | Nt GUI C++ Classes |
| Inherits | QList |
List of all members, including inherited members
Public Functions
| QPolygonF() | |
| QPolygonF(const QList<QPointF> &points) | |
| QPolygonF(std::initializer_list<QPointF> points) | |
| QPolygonF(qsizetype size) | |
| QPolygonF(const QRectF &rectangle) | |
| QPolygonF(const QPolygon &polygon) | |
| bool | isClosed() const |
| QRectF | boundingRect() const |
| void | translate(qreal dx, qreal dy) |
| void | translate(const QPointF &offset) |
| QPolygonF | translated(qreal dx, qreal dy) const |
| QPolygonF | translated(const QPointF &offset) const |
| bool | containsPoint(const QPointF &point, Qt::FillRule fillRule) const |
| QPolygon | toPolygon() const |
Detailed Description
See also QPolygon, QPainter::drawPolygon() and QPainterPath::addPolygon().
Differences from Qt
There are no united(), intersected() or subtracted().
Member Function Documentation
QPolygonF::QPolygonF()
Constructs an empty polygon.
QPolygonF::QPolygonF(const QList<QPointF> &points)
Constructs a polygon of points.
QPolygonF::QPolygonF(std::initializer_list<QPointF> points)
Constructs a polygon of points.
QPolygonF::QPolygonF(qsizetype size)
Constructs a polygon of size points at the origin.
QPolygonF::QPolygonF(const QRectF &rectangle)
Constructs the closed polygon of the corners of rectangle: five points, the first repeated.
QPolygonF::QPolygonF(const QPolygon &polygon)
Constructs a polygon of the points of polygon.
QRectF QPolygonF::boundingRect() const
Returns the smallest rectangle that contains the points.
bool QPolygonF::containsPoint(const QPointF &point, Qt::FillRule fillRule) const
Returns true if point is inside the polygon, closed, with fillRule; otherwise returns false.
bool QPolygonF::isClosed() const
Returns true if the last point is the first one; otherwise returns false.
QPolygon QPolygonF::toPolygon() const
Returns the polygon with its points rounded to integers.
void QPolygonF::translate(qreal dx, qreal dy)
Moves each point by dx and dy.
void QPolygonF::translate(const QPointF &offset)
This is an overloaded function.
Moves each point by offset.
QPolygonF QPolygonF::translated(qreal dx, qreal dy) const
Returns a copy moved by dx and dy.
QPolygonF QPolygonF::translated(const QPointF &offset) const
This is an overloaded function.
Returns a copy moved by offset.