QPolygon露
- PyQt5.QtGui.QPolygon
Description露
The QPolygon class provides a vector of points using integer precision.
A QPolygon object is a QVector<QPoint>. The easiest way to add points to a QPolygon is to use QVector鈥檚 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 QMatrix::map() function for more general transformations of QPolygons.
The QPolygon class is implicitly shared.
Methods露
- __init__()
TODO
- __init__(QPolygon)
TODO
- __init__(List[int])
TODO
- __init__(Iterable[QPoint])
TODO
- __init__(int)
TODO
- __init__(Any)
TODO
- __init__(QRect, closed: bool = False)
TODO
- append(QPoint)
TODO
- at(int) → QPoint
TODO
- boundingRect() → QRect
Returns the bounding rectangle of the polygon, or QRect(0, 0, 0, 0) if the polygon is empty.
See also
QVector::isEmpty().
- clear()
TODO
- __contains__(QPoint) → int
TODO
- contains(QPoint) → bool
TODO
- count() → int
TODO
- count(QPoint) → int
TODO
- data() → sip.voidptr
TODO
- __delitem__(int)
TODO
- __delitem__(slice)
TODO
- __eq__(QPolygon) → bool
TODO
- fill(QPoint, size: int = -1)
TODO
- first() → QPoint
TODO
- __getitem__(int) → QPoint
TODO
- __getitem__(slice) → QPolygon
TODO
- indexOf(QPoint, from: int = 0) → int
TODO
- insert(int, QPoint)
TODO
- intersected(QPolygon) → QPolygon
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
- intersects(QPolygon) → bool
TODO
- isEmpty() → bool
TODO
- last() → QPoint
TODO
- lastIndexOf(QPoint, from: int = -1) → int
TODO
- __len__() → int
TODO
- __lshift__(QPoint) → object
TODO
- mid(int, length: int = -1) → QPolygon
TODO
- __mul__(QTransform) → QPolygon
TODO
- __ne__(QPolygon) → bool
TODO
- point(int) → QPoint
TODO
- prepend(QPoint)
TODO
- putPoints(int, int, int, ...)
TODO
- putPoints(int, int, QPolygon, from: int = 0)
TODO
- remove(int)
TODO
- remove(int, int)
TODO
- replace(int, QPoint)
TODO
- __setitem__(int, QPoint)
TODO
- __setitem__(slice, QPolygon)
TODO
- setPoint(int, QPoint)
TODO
- setPoint(int, int, int)
See also
- setPoints(List[int])
TODO
- setPoints(int, int, ...)
TODO
- size() → int
TODO
- subtracted(QPolygon) → QPolygon
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.
- swap(QPolygon)
TODO
- translate(QPoint)
TODO
- translate(int, int)
Translates all points in the polygon by (dx, dy).
See also
- translated(int, int) → QPolygon
Returns a copy of the polygon that is translated by (dx, dy).
See also
- united(QPolygon) → QPolygon
Returns a polygon which is the union of this polygon and r.
Set operations on polygons, will treat the polygons as areas, and implicitly close the polygon.
See also
- value(int) → QPoint
TODO