Skip to content

PythonQt.QtGui.QPolygon

QPolygon

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

A QPolygon object is a QVector\<QPoint>. The easiest way to add points to a QPolygon is to use QVector's streaming operator, as illustrated below:

        QPolygon polygon;
        polygon << QPoint(10, 20) << QPoint(20, 30);

In addition to the functions provided by QVector, QPolygon provides some point-specific functions.

Each point in a polygon can be retrieved by passing its index to the point() function. To populate the polygon, QPolygon provides the setPoint() function to set the point at a given index, the setPoints() function to set all the points in the polygon (resizing it to the given number of points), and the putPoints() function which copies a number of given points into the polygon from a specified index (resizing the polygon if necessary).

QPolygon provides the boundingRect() and translate() functions for geometry functions. Use the QTransform::map() function for more general transformations of QPolygons.

The QPolygon class is implicitly shared.

Source: https://doc.qt.io/archives/qt-5.15/qpolygon.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
append function (self, t: Any) -> None
at function (self, i: int) -> Any X.at(i) -> PythonQt.QtCore.QPoint
boundingRect function (self) -> Any X.boundingRect() -> PythonQt.QtCore.QRect
capacity function (self) -> int X.capacity() -> int
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
clear function (self) -> None
constFirst function (self) -> Any X.constFirst() -> PythonQt.QtCore.QPoint
constLast function (self) -> Any X.constLast() -> PythonQt.QtCore.QPoint
contains function (self, t: Any) -> bool X.contains(t) -> bool
containsPoint function (self, pt: Any, fillRule: Any) -> bool X.containsPoint(pt, fillRule) -> bool
count function (self, t: Any) -> int X.count(t) -> int
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
empty function (self) -> bool X.empty() -> bool
endsWith function (self, t: Any) -> bool X.endsWith(t) -> bool
fill function (self, t: Any, size: int) -> tuple X.fill(t, size) -> tuple
first function (self) -> Any X.first() -> PythonQt.QtCore.QPoint
fromList function (self, list: Any) -> tuple X.fromList(list) -> tuple
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
indexOf function (self, *args: Any, **kwargs: Any) -> int X.indexOf(t, from) -> int
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
intersected function (self, r: Any) -> Any X.intersected(r) -> PythonQt.QtGui.QPolygon
isEmpty function (self) -> bool X.isEmpty() -> bool
isSharedWith function (self, other: Any) -> bool X.isSharedWith(other) -> bool
last function (self) -> Any X.last() -> PythonQt.QtCore.QPoint
lastIndexOf function (self, *args: Any, **kwargs: Any) -> int X.lastIndexOf(t, from) -> int
length function (self) -> int X.length() -> int
mid function (self, pos: int, len: int) -> tuple X.mid(pos, len) -> tuple
move function (self, *args: Any, **kwargs: Any) -> None X.move(from, to)
operator_assign function (self, other: Any) -> Any X.operator_assign(other) -> PythonQt.QtGui.QPolygon
pop_back function (self) -> None
pop_front function (self) -> None
prepend function (self, t: Any) -> None
push_back function (self, t: Any) -> None
push_front function (self, t: Any) -> None
readFrom function (self, stream: Any) -> Any
remove function (self, i: int, n: Any) -> None X.remove(i, n)
removeAll function (self, t: Any) -> int X.removeAll(t) -> int
removeAt function (self, i: int) -> None
removeFirst function (self) -> None
removeLast function (self) -> None
removeOne function (self, t: Any) -> bool X.removeOne(t) -> bool
replace function (self, i: int, t: Any) -> None X.replace(i, t)
reserve function (self, size: int) -> None
resize function (self, size: int) -> None
setSharable function (self, sharable: bool) -> None
size function (self) -> int X.size() -> int
squeeze function (self) -> None
startsWith function (self, t: Any) -> bool X.startsWith(t) -> bool
subtracted function (self, r: Any) -> Any X.subtracted(r) -> PythonQt.QtGui.QPolygon
swap function (self, other: Any) -> None Swaps polygon other with this polygon.
takeAt function (self, i: int) -> Any X.takeAt(i) -> PythonQt.QtCore.QPoint
takeFirst function (self) -> Any X.takeFirst() -> PythonQt.QtCore.QPoint
takeLast function (self) -> Any X.takeLast() -> PythonQt.QtCore.QPoint
toList function (self) -> tuple X.toList() -> tuple
translate function (self, dx: Any, dy: Any) -> None X.translate(dx, dy)
translated function (self, dx: Any, dy: Any) -> Any X.translated(dx, dy) -> PythonQt.QtGui.QPolygon
united function (self, r: Any) -> Any X.united(r) -> PythonQt.QtGui.QPolygon
value function (self, i: int, defaultValue: Any) -> Any X.value(i, defaultValue) -> PythonQt.QtCore.QPoint
writeTo function (self, stream: Any) -> Any