QPolygonF Class
A classe QPolygonF fornece uma lista de pontos com precisão de ponto flutuante. Mais...
| Cabeçalho: | #include <QPolygonF> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Gui) target_link_libraries(mytarget PRIVATE Qt6::Gui) |
| qmake: | QT += gui |
| Herdado de: | QList |
- Lista de todos os membros, incluindo os herdados
- QPolygonF faz parte das Classes de Pintura e das Classes Compartilhadas Implicitamente.
Observação: Todas as funções desta classe são reentrantes.
Funções públicas
| QPolygonF() | |
| QPolygonF(const QList<QPointF> &points) | |
| QPolygonF(const QPolygon &polygon) | |
| QPolygonF(const QRectF &rectangle) | |
| QRectF | boundingRect() const |
| bool | containsPoint(const QPointF &point, Qt::FillRule fillRule) const |
| QPolygonF | intersected(const QPolygonF &r) const |
| bool | intersects(const QPolygonF &p) const |
| bool | isClosed() const |
| QPolygonF | subtracted(const QPolygonF &r) const |
| void | swap(QPolygonF &other) |
| QPolygon | toPolygon() const |
| void | translate(const QPointF &offset) |
| void | translate(qreal dx, qreal dy) |
| QPolygonF | translated(const QPointF &offset) const |
| QPolygonF | translated(qreal dx, qreal dy) const |
| QPolygonF | united(const QPolygonF &r) const |
| operator QVariant() const |
Elementos não membros relacionados
| QDataStream & | operator<<(QDataStream &stream, const QPolygonF &polygon) |
| QDataStream & | operator>>(QDataStream &stream, QPolygonF &polygon) |
Descrição detalhada
Um QPolygonF é um objeto da classe ` QList` <QPointF>. A maneira mais fácil de adicionar pontos a um QPolygonF é usar seu operador de streaming, conforme ilustrado abaixo:
Além das funções fornecidas pelo QList, o QPolygonF oferece as funções boundingRect() e translate() para operações geométricas. Use a função QTransform::map() para transformações mais gerais de QPolygonFs.
O QPolygonF também oferece a função ` isClosed()` para determinar se os pontos inicial e final de um polígono são os mesmos, e a função ` toPolygon()`, que retorna uma cópia com precisão inteira desse polígono.
A classe QPolygonF é compartilhada implicitamente.
Veja também QList, QPolygon e QLineF.
Documentação das funções-membro
[constexpr noexcept default] QPolygonF::QPolygonF()
Cria um polígono sem pontos.
Veja também QList::isEmpty().
QPolygonF::QPolygonF(const QList<QPointF> &points)
Cria um polígono que contém o points especificado.
QPolygonF::QPolygonF(const QPolygon &polygon)
Cria um polígono com coordenadas em formato float a partir do polygon especificado, que contém coordenadas inteiras.
Veja também toPolygon().
QPolygonF::QPolygonF(const QRectF &rectangle)
Cria um polígono fechado a partir do rectangle especificado.
O polígono contém os quatro vértices do retângulo na ordem dos ponteiros do relógio, começando e terminando pelo vértice superior esquerdo.
Veja também isClosed().
QRectF QPolygonF::boundingRect() const
Retorna o retângulo delimitador do polígono ou QRectF(0,0,0,0) se o polígono estiver vazio.
Veja também QList::isEmpty().
bool QPolygonF::containsPoint(const QPointF &point, Qt::FillRule fillRule) const
Retorna ` true ` se o ` point ` fornecido estiver dentro do polígono, de acordo com o ` fillRule` especificado; caso contrário, retorna ` false`.
QPolygonF QPolygonF::intersected(const QPolygonF &r) const
Retorna um polígono que corresponde à interseção deste polígono com r.
As operações de união em polígonos tratarão os polígonos como áreas. Polígonos não fechados serão tratados como implicitamente fechados.
Veja também intersects().
bool QPolygonF::intersects(const QPolygonF &p) const
Retorna ` true ` se o polígono atual se intersectar em qualquer ponto com o polígono fornecido ` p`. Também retorna ` true ` se o polígono atual contiver ou for contido por qualquer parte de ` p`.
As operações de união em polígonos tratarão os polígonos como áreas. Polígonos não fechados serão tratados como implicitamente fechados.
Veja também intersected().
bool QPolygonF::isClosed() const
Retorna ` true ` se o polígono for fechado; caso contrário, retorna ` false`.
Diz-se que um polígono é fechado se seu ponto inicial e seu ponto final forem iguais.
Veja também QList::first() e QList::last().
QPolygonF QPolygonF::subtracted(const QPolygonF &r) const
Retorna um polígono que é o resultado da subtração de um polígono d r.
As operações de união em polígonos tratarão os polígonos como áreas. Polígonos não fechados serão tratados como implicitamente fechados.
void QPolygonF::swap(QPolygonF &other)
Troca este polígono por other. Essa operação é muito rápida e nunca falha.
QPolygon QPolygonF::toPolygon() const
Cria e retorna um ` QPolygon `, convertendo cada ` QPointF ` em um ` QPoint`.
Veja também QPointF::toPoint().
void QPolygonF::translate(const QPointF &offset)
Translate todos os pontos do polígono pela translação dada offset.
Veja também translated().
void QPolygonF::translate(qreal dx, qreal dy)
Transla todos os pontos do polígono em (dx, dy).
Esta é uma função sobrecarregada.
Veja também translated().
QPolygonF QPolygonF::translated(const QPointF &offset) const
Retorna uma cópia do polígono que é transladada pelo valor fornecido em offset.
Veja também translate().
QPolygonF QPolygonF::translated(qreal dx, qreal dy) const
Retorna uma cópia do polígono que é transladada por (dx, dy).
Esta é uma função sobrecarregada.
Veja também translate().
QPolygonF QPolygonF::united(const QPolygonF &r) const
Retorna um polígono que é a união deste polígono e de r.
As operações de conjunto em polígonos tratarão os polígonos como áreas. Polígonos não fechados serão tratados como implicitamente fechados.
Veja também ` intersected()` e ` subtracted()`.
QPolygonF::operator QVariant() const
Retorna o polígono como um objeto ` QVariant`.
Não-membros relacionados
QDataStream &operator<<(QDataStream &stream, const QPolygonF &polygon)
Grava o objeto ` polygon ` fornecido no objeto ` stream` fornecido e retorna uma referência ao fluxo.
Veja também Serialização detipos de dados do Qt.
QDataStream &operator>>(QDataStream &stream, QPolygonF &polygon)
Lê um polígono do arquivo ` stream ` especificado para o arquivo ` polygon` especificado e retorna uma referência ao fluxo.
Veja também Serialização detipos de dados do Qt.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.