• PySide 模块
  • PySide.QtGui
  • 内容表

    上一话题

    QPolygonF

    下一话题

    QColor

    QPolygon

    概要

    函数

    静态函数

    详细描述

    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 隐式共享 .

    class PySide.QtGui. QPolygon
    class PySide.QtGui. QPolygon ( a )
    class PySide.QtGui. QPolygon ( r [ , closed=false ] )
    class PySide.QtGui. QPolygon ( v )
    class PySide.QtGui. QPolygon ( size )
    参数:

    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()

    PySide.QtGui.QPolygon. __reduce__ ( )
    返回类型: PyObject
    PySide.QtGui.QPolygon. alignOfTypedData ( )
    返回类型: PySide.QtCore.int
    PySide.QtGui.QPolygon. append ( t )
    参数: t PySide.QtCore.QPoint
    PySide.QtGui.QPolygon. at ( i )
    参数: i PySide.QtCore.int
    返回类型: PySide.QtCore.QPoint
    PySide.QtGui.QPolygon. boundingRect ( )
    返回类型: 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.QtGui.QPolygon. capacity ( )
    返回类型: PySide.QtCore.int
    PySide.QtGui.QPolygon. clear ( )
    PySide.QtGui.QPolygon. constData ( )
    返回类型: PySide.QtCore.QPoint
    PySide.QtGui.QPolygon. contains ( t )
    参数: t PySide.QtCore.QPoint
    返回类型: PySide.QtCore.bool
    PySide.QtGui.QPolygon. containsPoint ( pt , fillRule )
    参数:
    返回类型:

    PySide.QtCore.bool

    PySide.QtGui.QPolygon. count ( )
    返回类型: PySide.QtCore.int
    PySide.QtGui.QPolygon. count ( t )
    参数: t PySide.QtCore.QPoint
    返回类型: PySide.QtCore.int
    PySide.QtGui.QPolygon. data ( )
    返回类型: PySide.QtCore.QPoint
    PySide.QtGui.QPolygon. detach_helper ( )
    PySide.QtGui.QPolygon. empty ( )
    返回类型: PySide.QtCore.bool
    PySide.QtGui.QPolygon. endsWith ( t )
    参数: t PySide.QtCore.QPoint
    返回类型: PySide.QtCore.bool
    PySide.QtGui.QPolygon. erase ( abegin , aend )
    参数:
    返回类型:

    PySide.QtCore.QPoint

    PySide.QtGui.QPolygon. fill ( t [ , size=-1 ] )
    参数:
    返回类型:

    PySide.QtGui.QPolygon. first ( )
    返回类型: PySide.QtCore.QPoint
    static PySide.QtGui.QPolygon. fromList ( list )
    参数: list
    返回类型:
    PySide.QtGui.QPolygon. front ( )
    返回类型: PySide.QtCore.QPoint
    PySide.QtGui.QPolygon. indexOf ( t [ , from=0 ] )
    参数:
    返回类型:

    PySide.QtCore.int

    PySide.QtGui.QPolygon. insert ( i , n , t )
    参数:
    PySide.QtGui.QPolygon. insert ( before , n , t )
    参数:
    返回类型:

    PySide.QtCore.QPoint

    PySide.QtGui.QPolygon. insert ( i , t )
    参数:
    PySide.QtGui.QPolygon. intersected ( r )
    参数: 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.QtGui.QPolygon. isEmpty ( )
    返回类型: PySide.QtCore.bool
    PySide.QtGui.QPolygon. isSharedWith ( other )
    参数: other
    返回类型: PySide.QtCore.bool
    PySide.QtGui.QPolygon. last ( )
    返回类型: PySide.QtCore.QPoint
    PySide.QtGui.QPolygon. lastIndexOf ( t [ , from=-1 ] )
    参数:
    返回类型:

    PySide.QtCore.int

    PySide.QtGui.QPolygon. mid ( pos [ , length=-1 ] )
    参数:
    • pos PySide.QtCore.int
    • length PySide.QtCore.int
    返回类型:

    PySide.QtGui.QPolygon. __ne__ ( v )
    参数: v
    返回类型: PySide.QtCore.bool
    PySide.QtGui.QPolygon. __mul__ ( m )
    参数: m PySide.QtGui.QTransform
    返回类型: PySide.QtGui.QPolygon
    PySide.QtGui.QPolygon. __mul__ ( m )
    参数: m PySide.QtGui.QMatrix
    返回类型: PySide.QtGui.QPolygon
    PySide.QtGui.QPolygon. __add__ ( l )
    参数: l
    返回类型:
    PySide.QtGui.QPolygon. __iadd__ ( t )
    参数: t PySide.QtCore.QPoint
    返回类型:
    PySide.QtGui.QPolygon. __lshift__ ( l )
    参数: l
    返回类型:
    PySide.QtGui.QPolygon. __lshift__ ( t )
    参数: t PySide.QtCore.QPoint
    返回类型:
    PySide.QtGui.QPolygon. __eq__ ( v )
    参数: v
    返回类型: PySide.QtCore.bool
    PySide.QtGui.QPolygon.operator[](i)
    参数: i PySide.QtCore.int
    返回类型: PySide.QtCore.QPoint
    PySide.QtGui.QPolygon. pop_back ( )
    PySide.QtGui.QPolygon. pop_front ( )
    PySide.QtGui.QPolygon. prepend ( t )
    参数: t PySide.QtCore.QPoint
    PySide.QtGui.QPolygon. push_back ( t )
    参数: t PySide.QtCore.QPoint
    PySide.QtGui.QPolygon. push_front ( t )
    参数: t PySide.QtCore.QPoint
    PySide.QtGui.QPolygon. realloc ( size , alloc )
    参数:
    • size PySide.QtCore.int
    • alloc PySide.QtCore.int
    PySide.QtGui.QPolygon. remove ( i , n )
    参数:
    • i PySide.QtCore.int
    • n PySide.QtCore.int
    PySide.QtGui.QPolygon. remove ( i )
    参数: i PySide.QtCore.int
    PySide.QtGui.QPolygon. replace ( i , t )
    参数:
    PySide.QtGui.QPolygon. reserve ( size )
    参数: size PySide.QtCore.int
    PySide.QtGui.QPolygon. resize ( size )
    参数: size PySide.QtCore.int
    PySide.QtGui.QPolygon. setSharable ( sharable )
    参数: sharable PySide.QtCore.bool
    PySide.QtGui.QPolygon. size ( )
    返回类型: PySide.QtCore.int
    PySide.QtGui.QPolygon. sizeOfTypedData ( )
    返回类型: PySide.QtCore.int
    PySide.QtGui.QPolygon. squeeze ( )
    PySide.QtGui.QPolygon. startsWith ( t )
    参数: t PySide.QtCore.QPoint
    返回类型: PySide.QtCore.bool
    PySide.QtGui.QPolygon. subtracted ( r )
    参数: 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.

    PySide.QtGui.QPolygon. swap ( other )
    参数: other PySide.QtGui.QPolygon

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

    PySide.QtGui.QPolygon. toList ( )
    返回类型:
    PySide.QtGui.QPolygon. translate ( offset )
    参数: offset PySide.QtCore.QPoint

    这是重载函数。

    Translates all points in the polygon by the given offset .

    PySide.QtGui.QPolygon. translate ( dx , dy )
    参数:
    • dx PySide.QtCore.int
    • dy PySide.QtCore.int

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

    PySide.QtGui.QPolygon. translated ( dx , dy )
    参数:
    • dx PySide.QtCore.int
    • dy PySide.QtCore.int
    返回类型:

    PySide.QtGui.QPolygon

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

    PySide.QtGui.QPolygon. translated ( offset )
    参数: offset PySide.QtCore.QPoint
    返回类型: PySide.QtGui.QPolygon

    这是重载函数。

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

    PySide.QtGui.QPolygon. united ( r )
    参数: 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.

    PySide.QtGui.QPolygon. value ( i )
    参数: i PySide.QtCore.int
    返回类型: PySide.QtCore.QPoint
    PySide.QtGui.QPolygon. value ( i , defaultValue )
    参数:
    返回类型:

    PySide.QtCore.QPoint