QGraphicsLineItem Class Reference
[QtGui module]
该QGraphicsLineItem类提供了一个行项目,你可以添加到QGraphicsScene。More…
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使用线路和钢笔的宽度,以提供合理的实施boundingRect( )shape()和contains( ) 。该paint( )函数绘制使用该项目的相关钢笔线。
Method Documentation
QGraphicsLineItem.__init__ (self, QGraphicsItem parent = None, QGraphicsScene scene = None)
该parent的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。
该scene的说法,如果不是没有,原因self通过Qt的,而不是PyQt的拥有。
构造一个QGraphicsLineItem。parent被传递给QGraphicsItem的构造。
See also QGraphicsScene.addItem( ) 。
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( ) 。
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,使用之间(线x1,y1)和(x2,y2)作为默认的行。parent被传递给QGraphicsItem的构造。
See also QGraphicsScene.addItem( ) 。
QRectF QGraphicsLineItem.boundingRect (self)
从重新实现QGraphicsItem.boundingRect( ) 。
bool QGraphicsLineItem.contains (self, QPointF point)
从重新实现QGraphicsItem.contains( ) 。
bool QGraphicsLineItem.isObscuredBy (self, QGraphicsItem item)
从重新实现QGraphicsItem.isObscuredBy( ) 。
QLineF QGraphicsLineItem.line (self)
[
返回该项目的路线,或者如果没有行被设置一个空行。
]($docs-qlinef.html)
QPainterPath QGraphicsLineItem.opaqueArea (self)
从重新实现QGraphicsItem.opaqueArea( ) 。
QGraphicsLineItem.paint (self, QPainter painter, QStyleOptionGraphicsItem option, QWidget widget = None)
从重新实现QGraphicsItem.paint( ) 。
QPen QGraphicsLineItem.pen (self)
[
返回该项目的钢笔或黑色固体0宽度的笔,如果没有笔已定。
]($docs-qpen.html)
QGraphicsLineItem.setLine (self, QLineF line)
设置项的行被定line。
See also line( ) 。
QGraphicsLineItem.setLine (self, float x1, float y1, float x2, float y2)
这是一个重载函数。
设置项的路线是之间的界线(x1,y1)和(x2,y2) 。
这是一样的调用setLine(QLineF(x1, y1, x2, y2))
。
QGraphicsLineItem.setPen (self, QPen pen)
设置项的笔pen。如果没有笔设置,线路将采用黑色固体0宽度的钢笔画。
See also pen( ) 。
QPainterPath QGraphicsLineItem.shape (self)
int QGraphicsLineItem.type (self)
从重新实现QGraphicsItem.type( ) 。