6.0.0-rc4Source

QPolygonF Class

The QPolygonF class is a list of points with real coordinates. More…

Header#include <QPolygonF>
CMaketarget_link_libraries(app PRIVATE Nt::Gui)
ModuleNt GUI C++ Classes
InheritsQList

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)
boolisClosed() const
QRectFboundingRect() const
voidtranslate(qreal dx, qreal dy)
voidtranslate(const QPointF &offset)
QPolygonFtranslated(qreal dx, qreal dy) const
QPolygonFtranslated(const QPointF &offset) const
boolcontainsPoint(const QPointF &point, Qt::FillRule fillRule) const
QPolygontoPolygon() 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.

[explicit] 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.