本文整理汇总了Python中PyQt4.QtGui.QGraphicsPathItem.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QGraphicsPathItem.__init__方法的具体用法?Python QGraphicsPathItem.__init__怎么用?Python QGraphicsPathItem.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QGraphicsPathItem
的用法示例。
在下文中一共展示了QGraphicsPathItem.__init__方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4.QtGui import QGraphicsPathItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsPathItem import __init__ [as 别名]
def __init__(self, graphics, *args):
QGraphicsPathItem.__init__(self, *args)
path = path_from_graphics(graphics)
self.setPath(path)
self.setAcceptHoverEvents(True)
self._actions = []
self.link = None
示例2: __init__
# 需要导入模块: from PyQt4.QtGui import QGraphicsPathItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsPathItem import __init__ [as 别名]
def __init__( self, edge, modObj, connObj ):
QGraphicsPathItem.__init__( self )
self.__edge = edge
self.__modObj = modObj
self.__connObj = connObj
startPoint = QPointF( edge.points[ 0 ][ 0 ], edge.points[ 0 ][ 1 ] )
painterPath = QPainterPath( startPoint )
index = 1
while index + 3 <= len( edge.points ):
painterPath.cubicTo(edge.points[index][0], edge.points[index][1],
edge.points[index+1][0],edge.points[index+1][1],
edge.points[index+2][0],edge.points[index+2][1])
index = index + 3
if index + 2 <= len( edge.points ):
painterPath.quadTo(edge.points[index+1][0], edge.points[index+1][1],
edge.points[index+2][0], edge.points[index+2][1])
index = index + 2
if index + 1 <= len( edge.points ):
painterPath.lineTo(edge.points[index+1][0], edge.points[index+1][1])
lastIndex = len( edge.points ) - 1
self.addArrow( painterPath,
edge.points[lastIndex-1][0],
edge.points[lastIndex-1][1],
edge.points[lastIndex][0],
edge.points[lastIndex][1] )
self.setPath( painterPath )
return
示例3: __init__
# 需要导入模块: from PyQt4.QtGui import QGraphicsPathItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsPathItem import __init__ [as 别名]
def __init__(self, radiusOut, raiusIn, angle, arcLen, parent=None):
QGraphicsPathItem.__init__(self, parent=parent)
self._radiusOut = radiusOut
self._raiusIn = raiusIn
self._angle = angle
self._arcLen = arcLen
self._pen = QPen(QColor('#000000'))
self._pen.setWidth(1)
self.setPen(self._pen)
self._hoverPen = QPen(QColor('#000000'))
self._hoverPen.setWidth(2)
brush = QBrush(QColor('#FF9966'))
self.setBrush(brush)
rectOut = QRectF(-radiusOut, -radiusOut, radiusOut*2.0, radiusOut*2.0)
rectIn = QRectF(-raiusIn, -raiusIn, raiusIn*2.0, raiusIn*2.0)
startAngle = angle - arcLen/2.0
endAngle = angle + arcLen/2.0
path = QPainterPath()
path.arcMoveTo(rectIn, startAngle)
path.arcTo(rectOut, startAngle, arcLen)
path.arcTo(rectIn, endAngle, 0)
path.arcTo(rectIn, endAngle, -arcLen)
self.setPath(path)
self._isHover = False
self._ioDragFirstPos = None
示例4: __init__
# 需要导入模块: from PyQt4.QtGui import QGraphicsPathItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsPathItem import __init__ [as 别名]
def __init__(self, longitudes, latitudes, scene, parent=None):
QGraphicsPathItem.__init__(self, parent=parent, scene=scene)
assert len(longitudes) == len(latitudes)
self._longitudes = np.array(longitudes, dtype=np.float32)
self._latitudes = np.array(latitudes, dtype=np.float32)
self.updatePosition(scene)
示例5: __init__
# 需要导入模块: from PyQt4.QtGui import QGraphicsPathItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsPathItem import __init__ [as 别名]
def __init__(self, parent=None):
QGraphicsPathItem.__init__(self, parent=parent)
self._startName = None
self._endName = None
self._path = None
self._startPos = None
self._endPos = None
pen = QPen(QBrush(QColor(Qt.black)), 2.0)
self.setPen(pen)
示例6: __init__
# 需要导入模块: from PyQt4.QtGui import QGraphicsPathItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsPathItem import __init__ [as 别名]
def __init__( self, settings, x1, y1, x2, y2 ):
QGraphicsPathItem.__init__( self )
self.__settings = settings
path = QPainterPath()
path.moveTo( x1, y1 )
path.lineTo( x2, y2 )
self.setPath( path )
self.penStyle = None
self.penColor = None
self.penWidth = None
return
示例7: __init__
# 需要导入模块: from PyQt4.QtGui import QGraphicsPathItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsPathItem import __init__ [as 别名]
def __init__(self, p0, p1, parent=None):
QGraphicsPathItem.__init__(self, parent=parent)
self._p0 = p0
self._p1 = p1
self._startPoint = QGraphicsEllipseItem(-3, -3, 6, 6, parent=self)
self._startPoint.setPos(p0)
self._endPoint = QGraphicsEllipseItem(-3, -3, 6, 6, parent=self)
self._endPoint.setVisible(False)
brush = QBrush(QColor(Qt.black))
self._startPoint.setBrush(brush)
self._endPoint.setBrush(brush)
pen = QPen(brush, 2.0)
self.setPen(pen)
示例8: __init__
# 需要导入模块: from PyQt4.QtGui import QGraphicsPathItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsPathItem import __init__ [as 别名]
def __init__(self, parent):
QGraphicsPathItem.__init__(self, parent)
if not isinstance(parent, LinkItem):
raise TypeError("'LinkItem' expected")
self.setAcceptedMouseButtons(Qt.NoButton)
self.__canvasLink = parent
self.setAcceptHoverEvents(True)
self.shadow = QGraphicsDropShadowEffect(blurRadius=5, color=QColor(SHADOW_COLOR), offset=QPointF(0, 0))
self.normalPen = QPen(QBrush(QColor("#9CACB4")), 2.0)
self.hoverPen = QPen(QBrush(QColor("#7D7D7D")), 2.1)
self.setPen(self.normalPen)
self.setGraphicsEffect(self.shadow)
self.shadow.setEnabled(False)
self.__hover = False
self.__enabled = True
self.__shape = None
示例9: __init__
# 需要导入模块: from PyQt4.QtGui import QGraphicsPathItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsPathItem import __init__ [as 别名]
def __init__(self, parent, pos, angle, length=0):
QGraphicsPathItem.__init__(self, parent)
AbstractSector.__init__(self, pos, angle, length)
示例10: __init__
# 需要导入模块: from PyQt4.QtGui import QGraphicsPathItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsPathItem import __init__ [as 别名]
def __init__(self, wave=None):
QGraphicsPathItem.__init__(self)
if wave:
self.loadWave(wave)