QGraphicsPolygonItem Class Reference

[QtGui module]

该QGraphicsPolygonItem类提供了一个多边形的项目,你可以添加到QGraphicsSceneMore…

继承QAbstractGraphicsShapeItem

Methods

  • __init__ (self, QGraphicsItem parent = None, QGraphicsScene scene = None)
  • __init__ (self, QPolygonF polygon, QGraphicsItem parent = None, QGraphicsScene scene = None)
  • QRectF boundingRect (self)
  • bool contains (self, QPointF point)
  • Qt.FillRule fillRule (self)
  • bool isObscuredBy (self, QGraphicsItem item)
  • QPainterPath opaqueArea (self)
  • paint (self, QPainter painter, QStyleOptionGraphicsItem option, QWidget widget = None)
  • QPolygonF polygon (self)
  • setFillRule (self, Qt.FillRule rule)
  • setPolygon (self, QPolygonF polygon)
  • QPainterPath shape (self)
  • int type (self)

Detailed Description

该QGraphicsPolygonItem类提供了一个多边形的项目,你可以添加到QGraphicsScene

要设置项目的多边形,通过一个QPolygonF到QGraphicsPolygonItem的构造函数,或致电setPolygon()函数。该polygon( )函数返回当前的多边形。

QGraphicsPolygonItem Class Reference - 图1

QGraphicsPolygonItem使用多边形和笔宽,以提供合理的实施boundingRect( )shape()和contains( ) 。该paint( )函数绘制使用该项目的相关的画笔和画刷多边形,你可以通过调用设置setPen()和setBrush()函数。


Method Documentation

  1. QGraphicsPolygonItem.__init__ (self, QGraphicsItem parent = None, QGraphicsScene scene = None)

parent的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。

scene的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。

构造一个QGraphicsPolygonItemparent被传递给QAbstractGraphicsShapeItem的构造。

See also QGraphicsScene.addItem( ) 。

  1. QGraphicsPolygonItem.__init__ (self, QPolygonF polygon, QGraphicsItem parent = None, QGraphicsScene scene = None)

parent的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。

scene的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。

构造一个QGraphicsPolygonItempolygon作为默认的多边形。parent被传递给QAbstractGraphicsShapeItem的构造。

See also QGraphicsScene.addItem( ) 。

  1. QRectF QGraphicsPolygonItem.boundingRect (self)

从重新实现QGraphicsItem.boundingRect( ) 。

  1. bool QGraphicsPolygonItem.contains (self, QPointF point)

从重新实现QGraphicsItem.contains( ) 。

  1. Qt.FillRule QGraphicsPolygonItem.fillRule (self)

返回多边形的填充规则。默认的填充规则是Qt.OddEvenFill

See also setFillRule( )QPainterPath.fillRule()和QPainter.drawPolygon( ) 。

  1. bool QGraphicsPolygonItem.isObscuredBy (self, QGraphicsItem item)

从重新实现QGraphicsItem.isObscuredBy( ) 。

  1. QPainterPath QGraphicsPolygonItem.opaqueArea (self)

从重新实现QGraphicsItem.opaqueArea( ) 。

  1. QGraphicsPolygonItem.paint (self, QPainter painter, QStyleOptionGraphicsItem option, QWidget widget = None)

从重新实现QGraphicsItem.paint( ) 。

  1. QPolygonF QGraphicsPolygonItem.polygon (self)

[

返回该项目的多边形,或者一个空的多边形,如果多边形没有被设置。

]($docs-qpolygonf.html)

See also setPolygon( ) 。

  1. QGraphicsPolygonItem.setFillRule (self, Qt.FillRule rule)

设置多边形的填充规则rule。默认的填充规则是Qt.OddEvenFill

See also fillRule( )QPainterPath.fillRule()和QPainter.drawPolygon( ) 。

  1. QGraphicsPolygonItem.setPolygon (self, QPolygonF polygon)

设置项的多边形也可以在给定polygon

See also polygon( ) 。

  1. QPainterPath QGraphicsPolygonItem.shape (self)

从重新实现QGraphicsItem.shape( ) 。

  1. int QGraphicsPolygonItem.type (self)

从重新实现QGraphicsItem.type( ) 。