内容表

上一话题

QPointingDeviceUniqueId

下一话题

QPolygonF

QPolygon

QPolygon class provides a vector of points using integer precision. 更多

Inheritance diagram of PySide2.QtGui.QPolygon

概要

函数

静态函数

详细描述

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:

polygon = QPolygon()
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 map() function for more general transformations of QPolygons.

QPolygon class is 隐式共享 .

另请参阅

QVector QPolygonF QLine

class QPolygon

QPolygon(v)

QPolygon(other)

QPolygon(r[, closed=false])

QPolygon(v)

QPolygon(size)

param closed

bool

param size

int

param other

QPolygon

param r

QRect

param v

QVector

Constructs a polygon with no points.

另请参阅

isEmpty()

Constructs a polygon of the given size . Creates an empty polygon if size == 0.

另请参阅

isEmpty()

PySide2.QtGui.QPolygon. __reduce__ ( )
返回类型

PyObject

PySide2.QtGui.QPolygon. append ( t )
参数

t QPoint

PySide2.QtGui.QPolygon. append ( t )
参数

t QPoint

PySide2.QtGui.QPolygon. append ( l )
参数

l

PySide2.QtGui.QPolygon. at ( i )
参数

i int

返回类型

QPoint

PySide2.QtGui.QPolygon. back ( )
返回类型

QPoint

PySide2.QtGui.QPolygon. boundingRect ( )
返回类型

QRect

Returns the bounding rectangle of the polygon, or QRect (0, 0, 0, 0) if the polygon is empty.

另请参阅

isEmpty()

PySide2.QtGui.QPolygon. capacity ( )
返回类型

int

PySide2.QtGui.QPolygon. clear ( )
PySide2.QtGui.QPolygon. constData ( )
返回类型

QPoint

PySide2.QtGui.QPolygon. constFirst ( )
返回类型

QPoint

PySide2.QtGui.QPolygon. constLast ( )
返回类型

QPoint

PySide2.QtGui.QPolygon. contains ( t )
参数

t QPoint

返回类型

bool

PySide2.QtGui.QPolygon. containsPoint ( pt , fillRule )
参数
  • pt QPoint

  • fillRule FillRule

返回类型

bool

返回 true 若给定 point is inside the polygon according to the specified fillRule ;否则返回 false .

PySide2.QtGui.QPolygon. count ( )
返回类型

int

PySide2.QtGui.QPolygon. count ( t )
参数

t QPoint

返回类型

int

PySide2.QtGui.QPolygon. data ( )
返回类型

QPoint

PySide2.QtGui.QPolygon. empty ( )
返回类型

bool

PySide2.QtGui.QPolygon. endsWith ( t )
参数

t QPoint

返回类型

bool

PySide2.QtGui.QPolygon. fill ( t [ , size=-1 ] )
参数
  • t QPoint

  • size int

返回类型

PySide2.QtGui.QPolygon. first ( )
返回类型

QPoint

static PySide2.QtGui.QPolygon. fromList ( list )
参数

list

返回类型

PySide2.QtGui.QPolygon. front ( )
返回类型

QPoint

PySide2.QtGui.QPolygon. indexOf ( t [ , from=0 ] )
参数
  • t QPoint

  • from int

返回类型

int

PySide2.QtGui.QPolygon. insert ( i , t )
参数
  • i int

  • t QPoint

PySide2.QtGui.QPolygon. insert ( i , t )
参数
  • i int

  • t QPoint

PySide2.QtGui.QPolygon. insert ( i , n , t )
参数
  • i int

  • n int

  • t QPoint

PySide2.QtGui.QPolygon. intersected ( r )
参数

r 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.

另请参阅

intersects()

PySide2.QtGui.QPolygon. intersects ( r )
参数

r QPolygon

返回类型

bool

返回 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.

另请参阅

intersected()

PySide2.QtGui.QPolygon. isEmpty ( )
返回类型

bool

PySide2.QtGui.QPolygon. isSharedWith ( other )
参数

other

返回类型

bool

PySide2.QtGui.QPolygon. last ( )
返回类型

QPoint

PySide2.QtGui.QPolygon. lastIndexOf ( t [ , from=-1 ] )
参数
  • t QPoint

  • from int

返回类型

int

PySide2.QtGui.QPolygon. length ( )
返回类型

int

PySide2.QtGui.QPolygon. mid ( pos [ , len=-1 ] )
参数
  • pos int

  • len int

返回类型

PySide2.QtGui.QPolygon. move ( from , to )
参数
  • from int

  • to int

PySide2.QtGui.QPolygon. __ne__ ( v )
参数

v

返回类型

bool

PySide2.QtGui.QPolygon. __mul__ ( m )
参数

m QMatrix

返回类型

QPolygon

PySide2.QtGui.QPolygon. __mul__ ( m )
参数

m QTransform

返回类型

QPolygon

PySide2.QtGui.QPolygon. __add__ ( l )
参数

l

返回类型

PySide2.QtGui.QPolygon. __iadd__ ( t )
参数

t QPoint

返回类型

PySide2.QtGui.QPolygon. __iadd__ ( t )
参数

t QPoint

返回类型

PySide2.QtGui.QPolygon. __lshift__ ( t )
参数

t QPoint

返回类型

PySide2.QtGui.QPolygon. __lshift__ ( t )
参数

t QPoint

返回类型

PySide2.QtGui.QPolygon. __lshift__ ( l )
参数

l

返回类型

PySide2.QtGui.QPolygon. __eq__ ( v )
参数

v

返回类型

bool

PySide2.QtGui.QPolygon.operator[](i)
参数

i int

返回类型

QPoint

PySide2.QtGui.QPolygon. pop_back ( )
PySide2.QtGui.QPolygon. pop_front ( )
PySide2.QtGui.QPolygon. prepend ( t )
参数

t QPoint

PySide2.QtGui.QPolygon. prepend ( t )
参数

t QPoint

PySide2.QtGui.QPolygon. push_back ( t )
参数

t QPoint

PySide2.QtGui.QPolygon. push_back ( t )
参数

t QPoint

PySide2.QtGui.QPolygon. push_front ( t )
参数

t QPoint

PySide2.QtGui.QPolygon. push_front ( t )
参数

t QPoint

PySide2.QtGui.QPolygon. remove ( i )
参数

i int

PySide2.QtGui.QPolygon. remove ( i , n )
参数
  • i int

  • n int

PySide2.QtGui.QPolygon. removeAll ( t )
参数

t QPoint

返回类型

int

PySide2.QtGui.QPolygon. removeAt ( i )
参数

i int

PySide2.QtGui.QPolygon. removeFirst ( )
PySide2.QtGui.QPolygon. removeLast ( )
PySide2.QtGui.QPolygon. removeOne ( t )
参数

t QPoint

返回类型

bool

PySide2.QtGui.QPolygon. replace ( i , t )
参数
  • i int

  • t QPoint

PySide2.QtGui.QPolygon. reserve ( size )
参数

size int

PySide2.QtGui.QPolygon. resize ( size )
参数

size int

PySide2.QtGui.QPolygon. setSharable ( sharable )
参数

sharable bool

PySide2.QtGui.QPolygon. shrink_to_fit ( )
PySide2.QtGui.QPolygon. size ( )
返回类型

int

PySide2.QtGui.QPolygon. squeeze ( )
PySide2.QtGui.QPolygon. startsWith ( t )
参数

t QPoint

返回类型

bool

PySide2.QtGui.QPolygon. subtracted ( r )
参数

r 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.

PySide2.QtGui.QPolygon. swap ( other )
参数

other QPolygon

Swaps polygon other with this polygon. This operation is very fast and never fails.

PySide2.QtGui.QPolygon. swapItemsAt ( i , j )
参数
  • i int

  • j int

PySide2.QtGui.QPolygon. takeAt ( i )
参数

i int

返回类型

QPoint

PySide2.QtGui.QPolygon. takeFirst ( )
返回类型

QPoint

PySide2.QtGui.QPolygon. takeLast ( )
返回类型

QPoint

PySide2.QtGui.QPolygon. toList ( )
返回类型

PySide2.QtGui.QPolygon. translate ( offset )
参数

offset QPoint

这是重载函数。

Translates all points in the polygon by the given offset .

另请参阅

translated()

PySide2.QtGui.QPolygon. translate ( dx , dy )
参数
  • dx int

  • dy int

Translates all points in the polygon by ( dx , dy ).

另请参阅

translated()

PySide2.QtGui.QPolygon. translated ( offset )
参数

offset QPoint

返回类型

QPolygon

这是重载函数。

Returns a copy of the polygon that is translated by the given offset .

另请参阅

translate()

PySide2.QtGui.QPolygon. translated ( dx , dy )
参数
  • dx int

  • dy int

返回类型

QPolygon

Returns a copy of the polygon that is translated by ( dx , dy ).

另请参阅

translate()

PySide2.QtGui.QPolygon. united ( r )
参数

r 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.

PySide2.QtGui.QPolygon. value ( i )
参数

i int

返回类型

QPoint

PySide2.QtGui.QPolygon. value ( i , defaultValue )
参数
  • i int

  • defaultValue QPoint

返回类型

QPoint