PySide.QtGui.QPolygon class provides a vector of points using integer precision.
A PySide.QtGui.QPolygon object is a QVector < PySide.QtCore.QPoint >. The easiest way to add points to a PySide.QtGui.QPolygon is to use QVector ‘s streaming operator, as illustrated below:
polygon = QPolygon()
polygon << QPoint(10, 20) << QPoint(20, 30)
In addition to the functions provided by QVector , PySide.QtGui.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, PySide.QtGui.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).
PySide.QtGui.QPolygon provides the PySide.QtGui.QPolygon.boundingRect() and PySide.QtGui.QPolygon.translate() functions for geometry functions. Use the QMatrix.map() function for more general transformations of QPolygons.
PySide.QtGui.QPolygon class is 隐式共享 .
另请参阅
| 参数: |
|
|---|
Constructs a polygon with no points.
另请参阅
QVector.isEmpty()
构造副本为给定 polygon .
另请参阅
setPoints()
Constructs a polygon from the given rectangle 。若 closed is false, the polygon just contains the four points of the rectangle ordered clockwise, otherwise the polygon's fifth point is set to rectangle . topLeft() .
Note that the bottom-right corner of the rectangle is located at (rectangle. x() + rectangle. width() , rectangle. y() + rectangle. height() ).
另请参阅
setPoints()
Constructs a polygon of the given size . Creates an empty polygon if size == 0.
另请参阅
QVector.isEmpty()
| 返回类型: | PyObject |
|---|
| 返回类型: | PySide.QtCore.int |
|---|
| 参数: | t – PySide.QtCore.QPoint |
|---|
| 参数: | i – PySide.QtCore.int |
|---|---|
| 返回类型: | PySide.QtCore.QPoint |
| 返回类型: | PySide.QtCore.QRect |
|---|
Returns the bounding rectangle of the polygon, or PySide.QtCore.QRect (0, 0, 0, 0) if the polygon is empty.
另请参阅
QVector.isEmpty()
| 返回类型: | PySide.QtCore.int |
|---|
| 返回类型: | PySide.QtCore.QPoint |
|---|
| 参数: | t – PySide.QtCore.QPoint |
|---|---|
| 返回类型: | PySide.QtCore.bool |
| 参数: |
|
|---|---|
| 返回类型: |
PySide.QtCore.bool |
| 返回类型: | PySide.QtCore.int |
|---|
| 参数: | t – PySide.QtCore.QPoint |
|---|---|
| 返回类型: | PySide.QtCore.int |
| 返回类型: | PySide.QtCore.QPoint |
|---|
| 返回类型: | PySide.QtCore.bool |
|---|
| 参数: | t – PySide.QtCore.QPoint |
|---|---|
| 返回类型: | PySide.QtCore.bool |
| 参数: |
|
|---|---|
| 返回类型: |
| 参数: |
|
|---|---|
| 返回类型: |
| 返回类型: | PySide.QtCore.QPoint |
|---|
| 参数: | list – |
|---|---|
| 返回类型: |
| 返回类型: | PySide.QtCore.QPoint |
|---|
| 参数: |
|
|---|---|
| 返回类型: |
PySide.QtCore.int |
| 参数: |
|
|---|
| 参数: |
|
|---|---|
| 返回类型: |
| 参数: |
|
|---|
| 参数: | r – PySide.QtGui.QPolygon |
|---|---|
| 返回类型: | PySide.QtGui.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.
| 返回类型: | PySide.QtCore.bool |
|---|
| 参数: | other – |
|---|---|
| 返回类型: | PySide.QtCore.bool |
| 返回类型: | PySide.QtCore.QPoint |
|---|
| 参数: |
|
|---|---|
| 返回类型: |
PySide.QtCore.int |
| 参数: |
|
|---|---|
| 返回类型: |
| 参数: | v – |
|---|---|
| 返回类型: | PySide.QtCore.bool |
| 参数: | m – PySide.QtGui.QTransform |
|---|---|
| 返回类型: | PySide.QtGui.QPolygon |
| 参数: | m – PySide.QtGui.QMatrix |
|---|---|
| 返回类型: | PySide.QtGui.QPolygon |
| 参数: | l – |
|---|---|
| 返回类型: |
| 参数: | t – PySide.QtCore.QPoint |
|---|---|
| 返回类型: |
| 参数: | l – |
|---|---|
| 返回类型: |
| 参数: | t – PySide.QtCore.QPoint |
|---|---|
| 返回类型: |
| 参数: | v – |
|---|---|
| 返回类型: | PySide.QtCore.bool |
| 参数: | i – PySide.QtCore.int |
|---|---|
| 返回类型: | PySide.QtCore.QPoint |
| 参数: | t – PySide.QtCore.QPoint |
|---|
| 参数: | t – PySide.QtCore.QPoint |
|---|
| 参数: | t – PySide.QtCore.QPoint |
|---|
| 参数: |
|
|---|
| 参数: |
|
|---|
| 参数: | i – PySide.QtCore.int |
|---|
| 参数: |
|
|---|
| 参数: | size – PySide.QtCore.int |
|---|
| 参数: | size – PySide.QtCore.int |
|---|
| 参数: | sharable – PySide.QtCore.bool |
|---|
| 返回类型: | PySide.QtCore.int |
|---|
| 返回类型: | PySide.QtCore.int |
|---|
| 参数: | t – PySide.QtCore.QPoint |
|---|---|
| 返回类型: | PySide.QtCore.bool |
| 参数: | r – PySide.QtGui.QPolygon |
|---|---|
| 返回类型: | PySide.QtGui.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.
| 参数: | other – PySide.QtGui.QPolygon |
|---|
Swaps polygon other with this polygon. This operation is very fast and never fails.
| 返回类型: |
|---|
| 参数: | offset – PySide.QtCore.QPoint |
|---|
这是重载函数。
Translates all points in the polygon by the given offset .
| 参数: |
|
|---|
Translates all points in the polygon by ( dx , dy ).
| 参数: |
|
|---|---|
| 返回类型: |
Returns a copy of the polygon that is translated by ( dx , dy ).
| 参数: | offset – PySide.QtCore.QPoint |
|---|---|
| 返回类型: | PySide.QtGui.QPolygon |
这是重载函数。
Returns a copy of the polygon that is translated by the given offset .
| 参数: | r – PySide.QtGui.QPolygon |
|---|---|
| 返回类型: | PySide.QtGui.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.
| 参数: | i – PySide.QtCore.int |
|---|---|
| 返回类型: | PySide.QtCore.QPoint |
| 参数: |
|
|---|---|
| 返回类型: |