QPolygonF¶
The QPolygonF
class provides a list of points using floating point precision. More…
Synopsis¶
Functions¶
def
__add__
(l)def
__mul__
(m)def
append
(arg__1)def
append
(l)def
at
(i)def
back
()def
boundingRect
()def
capacity
()def
clear
()def
constData
()def
constFirst
()def
constLast
()def
containsPoint
(pt, fillRule)def
count
()def
data
()def
empty
()def
first
()def
first
(n)def
front
()def
insert
(arg__1, arg__2)def
intersected
(r)def
intersects
(r)def
isClosed
()def
isEmpty
()def
isSharedWith
(other)def
last
()def
last
(n)def
length
()def
mid
(pos[, len=-1])def
move
(from, to)def
operator[]
(i)def
pop_back
()def
pop_front
()def
prepend
(arg__1)def
push_back
(arg__1)def
push_front
(arg__1)def
remove
(i[, n=1])def
removeAll
(arg__1)def
removeAt
(i)def
removeFirst
()def
removeLast
()def
removeOne
(arg__1)def
reserve
(size)def
resize
(size)def
shrink_to_fit
()def
size
()def
sliced
(pos)def
sliced
(pos, n)def
squeeze
()def
subtracted
(r)def
swap
(other)def
swapItemsAt
(i, j)def
takeAt
(i)def
toList
()def
toPolygon
()def
toVector
()def
translate
(dx, dy)def
translate
(offset)def
translated
(dx, dy)def
translated
(offset)def
united
(r)def
value
(i)
Static functions¶
def
fromList
(list)def
fromVector
(vector)
Detailed Description¶
A QPolygonF
is a QList
< QPointF
>. The easiest way to add points to a QPolygonF
is to use its streaming operator, as illustrated below:
polygon = QPolygonF() polygon << QPointF(10.4, 20.5) << QPointF(20.2, 30.2)
In addition to the functions provided by QList
, QPolygonF
provides the boundingRect()
and translate()
functions for geometry operations. Use the map()
function for more general transformations of QPolygonFs.
QPolygonF
also provides the isClosed()
function to determine whether a polygon’s start and end points are the same, and the toPolygon()
function returning an integer precision copy of this polygon.
The QPolygonF
class is implicitly shared .
See also
QList
QPolygon
QLineF
- class PySide6.QtGui.QPolygonF¶
PySide6.QtGui.QPolygonF(v)
PySide6.QtGui.QPolygonF(v)
PySide6.QtGui.QPolygonF(a)
PySide6.QtGui.QPolygonF(QPolygonF)
PySide6.QtGui.QPolygonF(r)
- Parameters
QPolygonF –
PySide6.QtGui.QPolygonF
v –
Constructs a polygon with no points.
See also
isEmpty()
Constructs a float based polygon from the specified integer based polygon
.
See also
Constructs a closed polygon from the specified rectangle
.
The polygon contains the four vertices of the rectangle in clockwise order starting and ending with the top-left vertex.
See also
- PySide6.QtGui.QPolygonF.append(arg__1)¶
- Parameters
arg__1 –
PySide6.QtCore.QPointF
- PySide6.QtGui.QPolygonF.append(l)
- Parameters
l –
- PySide6.QtGui.QPolygonF.at(i)¶
- Parameters
i –
qsizetype
- Return type
- PySide6.QtGui.QPolygonF.back()¶
- Return type
- PySide6.QtGui.QPolygonF.boundingRect()¶
- Return type
Returns the bounding rectangle of the polygon, or QRectF
(0,0,0,0) if the polygon is empty.
See also
isEmpty()
- PySide6.QtGui.QPolygonF.capacity()¶
- Return type
qsizetype
- PySide6.QtGui.QPolygonF.clear()¶
- PySide6.QtGui.QPolygonF.constData()¶
- Return type
- PySide6.QtGui.QPolygonF.constFirst()¶
- Return type
- PySide6.QtGui.QPolygonF.constLast()¶
- Return type
- PySide6.QtGui.QPolygonF.containsPoint(pt, fillRule)¶
- Parameters
fillRule –
FillRule
- Return type
bool
Returns true
if the given point
is inside the polygon according to the specified fillRule
; otherwise returns false
.
- PySide6.QtGui.QPolygonF.count()¶
- Return type
qsizetype
- PySide6.QtGui.QPolygonF.data()¶
- Return type
- PySide6.QtGui.QPolygonF.empty()¶
- Return type
bool
- PySide6.QtGui.QPolygonF.first(n)¶
- Parameters
n –
qsizetype
- Return type
- PySide6.QtGui.QPolygonF.first()
- Return type
- static PySide6.QtGui.QPolygonF.fromList(list)¶
- Parameters
list –
- Return type
- static PySide6.QtGui.QPolygonF.fromVector(vector)¶
- Parameters
vector –
- Return type
- PySide6.QtGui.QPolygonF.front()¶
- Return type
- PySide6.QtGui.QPolygonF.insert(arg__1, arg__2)¶
- Parameters
arg__1 –
qsizetype
arg__2 –
PySide6.QtCore.QPointF
- PySide6.QtGui.QPolygonF.intersected(r)¶
- Parameters
- Return type
Returns a polygon which is the intersection of this polygon and r
.
Set operations on polygons will treat the polygons as areas. Non-closed polygons will be treated as implicitly closed.
See also
- PySide6.QtGui.QPolygonF.intersects(r)¶
- Parameters
- Return type
bool
Returns true
if the current polygon intersects at any point the given polygon p
. Also returns true
if the current polygon contains or is contained by any part of p
.
Set operations on polygons will treat the polygons as areas. Non-closed polygons will be treated as implicitly closed.
See also
- PySide6.QtGui.QPolygonF.isClosed()¶
- Return type
bool
Returns true
if the polygon is closed; otherwise returns false
.
A polygon is said to be closed if its start point and end point are equal.
See also
first()
last()
- PySide6.QtGui.QPolygonF.isEmpty()¶
- Return type
bool
- Parameters
other –
- Return type
bool
- PySide6.QtGui.QPolygonF.last()¶
- Return type
- PySide6.QtGui.QPolygonF.last(n)
- Parameters
n –
qsizetype
- Return type
- PySide6.QtGui.QPolygonF.length()¶
- Return type
qsizetype
- PySide6.QtGui.QPolygonF.mid(pos[, len=-1])¶
- Parameters
pos –
qsizetype
len –
qsizetype
- Return type
- PySide6.QtGui.QPolygonF.move(from, to)¶
- Parameters
from –
qsizetype
to –
qsizetype
- PySide6.QtGui.QPolygonF.__mul__(m)¶
- Parameters
- Return type
- PySide6.QtGui.QPolygonF.__add__(l)¶
- Parameters
l –
- Return type
- PySide6.QtGui.QPolygonF.operator[](i)
- Parameters
i –
qsizetype
- Return type
- PySide6.QtGui.QPolygonF.pop_back()¶
- PySide6.QtGui.QPolygonF.pop_front()¶
- PySide6.QtGui.QPolygonF.prepend(arg__1)¶
- Parameters
arg__1 –
PySide6.QtCore.QPointF
- PySide6.QtGui.QPolygonF.push_back(arg__1)¶
- Parameters
arg__1 –
PySide6.QtCore.QPointF
- PySide6.QtGui.QPolygonF.push_front(arg__1)¶
- Parameters
arg__1 –
PySide6.QtCore.QPointF
- PySide6.QtGui.QPolygonF.remove(i[, n=1])¶
- Parameters
i –
qsizetype
n –
qsizetype
- PySide6.QtGui.QPolygonF.removeAll(arg__1)¶
- Parameters
arg__1 –
PySide6.QtCore.QPointF
- PySide6.QtGui.QPolygonF.removeAt(i)¶
- Parameters
i –
qsizetype
- PySide6.QtGui.QPolygonF.removeFirst()¶
- PySide6.QtGui.QPolygonF.removeLast()¶
- PySide6.QtGui.QPolygonF.removeOne(arg__1)¶
- Parameters
arg__1 –
PySide6.QtCore.QPointF
- PySide6.QtGui.QPolygonF.reserve(size)¶
- Parameters
size –
qsizetype
- PySide6.QtGui.QPolygonF.resize(size)¶
- Parameters
size –
qsizetype
- PySide6.QtGui.QPolygonF.shrink_to_fit()¶
- PySide6.QtGui.QPolygonF.size()¶
- Return type
qsizetype
- PySide6.QtGui.QPolygonF.sliced(pos)¶
- Parameters
pos –
qsizetype
- Return type
- PySide6.QtGui.QPolygonF.sliced(pos, n)
- Parameters
pos –
qsizetype
n –
qsizetype
- Return type
- PySide6.QtGui.QPolygonF.squeeze()¶
- PySide6.QtGui.QPolygonF.subtracted(r)¶
- Parameters
- Return type
Returns a polygon which is r
subtracted from this polygon.
Set operations on polygons will treat the polygons as areas. Non-closed polygons will be treated as implicitly closed.
- PySide6.QtGui.QPolygonF.swap(other)¶
- Parameters
other –
PySide6.QtGui.QPolygonF
Swaps polygon other
with this polygon. This operation is very fast and never fails.
- PySide6.QtGui.QPolygonF.swapItemsAt(i, j)¶
- Parameters
i –
qsizetype
j –
qsizetype
- PySide6.QtGui.QPolygonF.takeAt(i)¶
- Parameters
i –
qsizetype
- Return type
- PySide6.QtGui.QPolygonF.toList()¶
- Return type
- PySide6.QtGui.QPolygonF.toPolygon()¶
- Return type
Creates and returns a QPolygon
by converting each QPointF
to a QPoint
.
See also
toPoint()
- PySide6.QtGui.QPolygonF.toVector()¶
- Return type
- PySide6.QtGui.QPolygonF.translate(offset)¶
- Parameters
offset –
PySide6.QtCore.QPointF
Translate all points in the polygon by the given offset
.
See also
- PySide6.QtGui.QPolygonF.translate(dx, dy)
- Parameters
dx – float
dy – float
This is an overloaded function.
Translates all points in the polygon by (dx
, dy
).
See also
- PySide6.QtGui.QPolygonF.translated(offset)¶
- Parameters
offset –
PySide6.QtCore.QPointF
- Return type
Returns a copy of the polygon that is translated by the given offset
.
See also
- PySide6.QtGui.QPolygonF.translated(dx, dy)
- Parameters
dx – float
dy – float
- Return type
This is an overloaded function.
Returns a copy of the polygon that is translated by (dx
, dy
).
See also
- PySide6.QtGui.QPolygonF.united(r)¶
- Parameters
- Return type
Returns a polygon which is the union of this polygon and r
.
Set operations on polygons will treat the polygons as areas. Non-closed polygons will be treated as implicitly closed.
See also
- PySide6.QtGui.QPolygonF.value(i)¶
- Parameters
i –
qsizetype
- Return type
© 2022 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.