QGraphicsLineItem Class Reference

[QtGui module]

该QGraphicsLineItem类提供了一个行项目,你可以添加到QGraphicsSceneMore…

继承QGraphicsItem

Methods

  • __init__ (self, QGraphicsItem parent = None, QGraphicsScene scene = None)
  • __init__ (self, QLineF line, QGraphicsItem parent = None, QGraphicsScene scene = None)
  • __init__ (self, float x1, float y1, float x2, float y2, QGraphicsItem parent = None, QGraphicsScene scene = None)
  • QRectF boundingRect (self)
  • bool contains (self, QPointF point)
  • bool isObscuredBy (self, QGraphicsItem item)
  • QLineF line (self)
  • QPainterPath opaqueArea (self)
  • paint (self, QPainter painter, QStyleOptionGraphicsItem option, QWidget widget = None)
  • QPen pen (self)
  • setLine (self, QLineF line)
  • setLine (self, float x1, float y1, float x2, float y2)
  • setPen (self, QPen pen)
  • QPainterPath shape (self)
  • int type (self)

Detailed Description

该QGraphicsLineItem类提供了一个行项目,你可以添加到QGraphicsScene

要设置项目的路线,通过一个QLineF到QGraphicsLineItem的构造函数,或致电setLine()函数。该line( )函数返回当前行。默认情况下,该线是黑色的宽度为0 ,但可以通过调用改变这个setPen( ) 。

QGraphicsLineItem Class Reference - 图1

QGraphicsLineItem使用线路和钢笔的宽度,以提供合理的实施boundingRect( )shape()和contains( ) 。该paint( )函数绘制使用该项目的相关钢笔线。


Method Documentation

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

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

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

构造一个QGraphicsLineItemparent被传递给QGraphicsItem的构造。

See also QGraphicsScene.addItem( ) 。

  1. QGraphicsLineItem.__init__ (self, QLineF line, QGraphicsItem parent = None, QGraphicsScene scene = None)

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

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

构造一个QGraphicsLineItem,使用line作为默认的行。parent被传递给QGraphicsItem的构造。

See also QGraphicsScene.addItem( ) 。

  1. QGraphicsLineItem.__init__ (self, float x1, float y1, float x2, float y2, QGraphicsItem parent = None, QGraphicsScene scene = None)

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

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

构造一个QGraphicsLineItem,使用之间(线x1y1)和(x2y2)作为默认的行。parent被传递给QGraphicsItem的构造。

See also QGraphicsScene.addItem( ) 。

  1. QRectF QGraphicsLineItem.boundingRect (self)

从重新实现QGraphicsItem.boundingRect( ) 。

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

从重新实现QGraphicsItem.contains( ) 。

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

从重新实现QGraphicsItem.isObscuredBy( ) 。

  1. QLineF QGraphicsLineItem.line (self)

[

返回该项目的路线,或者如果没有行被设置一个空行。

]($docs-qlinef.html)

See also setLine( ) 。

  1. QPainterPath QGraphicsLineItem.opaqueArea (self)

从重新实现QGraphicsItem.opaqueArea( ) 。

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

从重新实现QGraphicsItem.paint( ) 。

  1. QPen QGraphicsLineItem.pen (self)

[

返回该项目的钢笔或黑色固体0宽度的笔,如果没有笔已定。

]($docs-qpen.html)

See also setPen( ) 。

  1. QGraphicsLineItem.setLine (self, QLineF line)

设置项的行被定line

See also line( ) 。

  1. QGraphicsLineItem.setLine (self, float x1, float y1, float x2, float y2)

这是一个重载函数。

设置项的路线是之间的界线(x1y1)和(x2y2) 。

这是一样的调用setLine(QLineF(x1, y1, x2, y2))

  1. QGraphicsLineItem.setPen (self, QPen pen)

设置项的笔pen。如果没有笔设置,线路将采用黑色固体0宽度的钢笔画。

See also pen( ) 。

  1. QPainterPath QGraphicsLineItem.shape (self)

从重新实现QGraphicsItem.shape( ) 。

  1. int QGraphicsLineItem.type (self)

从重新实现QGraphicsItem.type( ) 。