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

    上一话题

    QGraphicsPolygonItem

    下一话题

    QGraphicsRectItem

    QGraphicsEllipseItem

    概要

    函数

    详细描述

    PySide.QtGui.QGraphicsEllipseItem class provides an ellipse item that you can add to a PySide.QtGui.QGraphicsScene .

    PySide.QtGui.QGraphicsEllipseItem respresents an ellipse with a fill and an outline, and you can also use it for ellipse segments (see PySide.QtGui.QGraphicsEllipseItem.startAngle() , PySide.QtGui.QGraphicsEllipseItem.spanAngle() ).

    ../../_images/graphicsview-ellipseitem.png ../../_images/graphicsview-ellipseitem-pie.png

    To set the item's ellipse, pass a PySide.QtCore.QRectF to PySide.QtGui.QGraphicsEllipseItem ‘s constructor, or call PySide.QtGui.QGraphicsEllipseItem.setRect() PySide.QtGui.QGraphicsEllipseItem.rect() function returns the current ellipse geometry.

    PySide.QtGui.QGraphicsEllipseItem uses the rect and the pen width to provide a reasonable implementation of PySide.QtGui.QGraphicsEllipseItem.boundingRect() , PySide.QtGui.QGraphicsEllipseItem.shape() ,和 PySide.QtGui.QGraphicsEllipseItem.contains() PySide.QtGui.QGraphicsEllipseItem.paint() function draws the ellipse using the item's associated pen and brush, which you can set by calling PySide.QtGui.QAbstractGraphicsShapeItem.setPen() and PySide.QtGui.QAbstractGraphicsShapeItem.setBrush() .

    class PySide.QtGui. QGraphicsEllipseItem ( [ parent=None [ , scene=None ] ] )
    class PySide.QtGui. QGraphicsEllipseItem ( rect [ , parent=None [ , scene=None ] ] )
    class PySide.QtGui. QGraphicsEllipseItem ( x , y , w , h [ , parent=None [ , scene=None ] ] )
    参数:
    PySide.QtGui.QGraphicsEllipseItem. rect ( )
    返回类型: PySide.QtCore.QRectF

    Returns the item's ellipse geometry as a PySide.QtCore.QRectF .

    PySide.QtGui.QGraphicsEllipseItem. setRect ( rect )
    参数: rect PySide.QtCore.QRectF

    Sets the item's ellipse geometry to rect . The rectangle's left edge defines the left edge of the ellipse, and the rectangle's top edge describes the top of the ellipse. The height and width of the rectangle describe the height and width of the ellipse.

    PySide.QtGui.QGraphicsEllipseItem. setRect ( x , y , w , h )
    参数:
    • x PySide.QtCore.qreal
    • y PySide.QtCore.qreal
    • w PySide.QtCore.qreal
    • h PySide.QtCore.qreal

    Sets the item's rectangle to the rectangle defined by ( x , y ) and the given width and height .

    This convenience function is equivalent to calling setRect(QRectF(x, y, width, height))

    PySide.QtGui.QGraphicsEllipseItem. setSpanAngle ( angle )
    参数: angle PySide.QtCore.int

    Sets the span angle for an ellipse segment to angle , which is in 16ths of a degree. This angle is used together with PySide.QtGui.QGraphicsEllipseItem.startAngle() to represent an ellipse segment (a pie). By default, the span angle is 5760 (360 * 16, a full ellipse).

    PySide.QtGui.QGraphicsEllipseItem. setStartAngle ( angle )
    参数: angle PySide.QtCore.int

    Sets the start angle for an ellipse segment to angle , which is in 16ths of a degree. This angle is used together with PySide.QtGui.QGraphicsEllipseItem.spanAngle() for representing an ellipse segment (a pie). By default, the start angle is 0.

    PySide.QtGui.QGraphicsEllipseItem. spanAngle ( )
    返回类型: PySide.QtCore.int

    Returns the span angle of an ellipse segment in 16ths of a degree. This angle is used together with PySide.QtGui.QGraphicsEllipseItem.startAngle() for representing an ellipse segment (a pie). By default, this function returns 5760 (360 * 16, a full ellipse).

    PySide.QtGui.QGraphicsEllipseItem. startAngle ( )
    返回类型: PySide.QtCore.int

    Returns the start angle for an ellipse segment in 16ths of a degree. This angle is used together with PySide.QtGui.QGraphicsEllipseItem.spanAngle() for representing an ellipse segment (a pie). By default, the start angle is 0.