当前位置: 首页>>代码示例>>Python>>正文


Python QGraphicsPathItem.__init__方法代码示例

本文整理汇总了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
开发者ID:nagyistoce,项目名称:orange-bio,代码行数:9,代码来源:OWKEGGPathwayBrowser.py

示例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
开发者ID:eaglexmw,项目名称:codimension,代码行数:34,代码来源:importsdgmgraphics.py

示例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
开发者ID:allebacco,项目名称:PyNodeGraph,代码行数:36,代码来源:connector_item.py

示例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)
开发者ID:rugolotti,项目名称:PyTileMap,代码行数:11,代码来源:mapitems.py

示例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)
开发者ID:allebacco,项目名称:PyNodeGraph,代码行数:14,代码来源:connection_item.py

示例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
开发者ID:fukanchik,项目名称:codimension,代码行数:15,代码来源:auxitems.py

示例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)
开发者ID:sonictk,项目名称:PyNodeGraph,代码行数:19,代码来源:dragged_line_item.py

示例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
开发者ID:joshz,项目名称:orange3,代码行数:22,代码来源:linkitem.py

示例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)
开发者ID:Pesa,项目名称:forse,代码行数:5,代码来源:Track.py

示例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)
开发者ID:rhetr,项目名称:surplus,代码行数:6,代码来源:peaks.py


注:本文中的PyQt4.QtGui.QGraphicsPathItem.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。