QGraphicsPathItem Class Reference

[QtGui module]

该QGraphicsPathItem类提供了可以添加到一个路径项QGraphicsSceneMore…

继承QAbstractGraphicsShapeItem

Methods

  • __init__ (self, QGraphicsItem parent = None, QGraphicsScene scene = None)
  • __init__ (self, QPainterPath path, QGraphicsItem parent = None, QGraphicsScene scene = None)
  • QRectF boundingRect (self)
  • bool contains (self, QPointF point)
  • bool isObscuredBy (self, QGraphicsItem item)
  • QPainterPath opaqueArea (self)
  • paint (self, QPainter painter, QStyleOptionGraphicsItem option, QWidget widget = None)
  • QPainterPath path (self)
  • setPath (self, QPainterPath path)
  • QPainterPath shape (self)
  • int type (self)

Detailed Description

该QGraphicsPathItem类提供了可以添加到一个路径项QGraphicsScene

要设置项目的路径,通过一个QPainterPath到QGraphicsPathItem的构造函数,或致电setPath()函数。该path( )函数返回当前路径。

QGraphicsPathItem Class Reference - 图1

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


Method Documentation

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

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

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

构造一个QGraphicsPath 。parent被传递给QAbstractGraphicsShapeItem的构造。

See also QGraphicsScene.addItem( ) 。

  1. QGraphicsPathItem.__init__ (self, QPainterPath path, QGraphicsItem parent = None, QGraphicsScene scene = None)

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

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

构造使用QGraphicsPath项目path作为默认的路径。parent被传递给QAbstractGraphicsShapeItem的构造。

See also QGraphicsScene.addItem( ) 。

  1. QRectF QGraphicsPathItem.boundingRect (self)

从重新实现QGraphicsItem.boundingRect( ) 。

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

从重新实现QGraphicsItem.contains( ) 。

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

从重新实现QGraphicsItem.isObscuredBy( ) 。

  1. QPainterPath QGraphicsPathItem.opaqueArea (self)

从重新实现QGraphicsItem.opaqueArea( ) 。

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

从重新实现QGraphicsItem.paint( ) 。

  1. QPainterPath QGraphicsPathItem.path (self)

[

  1. QGraphicsPathItem.setPath (self, QPainterPath path)

设置项的路径,以在给定path

]($docs-qpainterpath.html)

See also path( ) 。

  1. QPainterPath QGraphicsPathItem.shape (self)

从重新实现QGraphicsItem.shape( ) 。

  1. int QGraphicsPathItem.type (self)

从重新实现QGraphicsItem.type( ) 。