本文整理匯總了Python中PyQt5.QtWidgets.QGraphicsLineItem.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python QGraphicsLineItem.__init__方法的具體用法?Python QGraphicsLineItem.__init__怎麽用?Python QGraphicsLineItem.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyQt5.QtWidgets.QGraphicsLineItem
的用法示例。
在下文中一共展示了QGraphicsLineItem.__init__方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from PyQt5.QtWidgets import QGraphicsLineItem [as 別名]
# 或者: from PyQt5.QtWidgets.QGraphicsLineItem import __init__ [as 別名]
def __init__(self, source, dest, id, graphicsGraphView):
# Parent constructor(s)
GraphicsEdge.__init__(self, source, dest, id, graphicsGraphView)
QGraphicsLineItem.__init__(self)
self.setFlag(QGraphicsItem.ItemIsSelectable)
self.update()
示例2: __init__
# 需要導入模塊: from PyQt5.QtWidgets import QGraphicsLineItem [as 別名]
# 或者: from PyQt5.QtWidgets.QGraphicsLineItem import __init__ [as 別名]
def __init__(self, shape):
QGraphicsLineItem.__init__(self)
StMove.__init__(self, shape)
self.allwaysshow = False
self.path = QPainterPath()
self.setFlag(QGraphicsItem.ItemIsSelectable, False)
self.pen = QPen(QColor(50, 100, 255), 1, QtCore.Qt.SolidLine,
QtCore.Qt.RoundCap, QtCore.Qt.RoundJoin)
self.pen.setCosmetic(True)
self.make_papath()
示例3: __init__
# 需要導入模塊: from PyQt5.QtWidgets import QGraphicsLineItem [as 別名]
# 或者: from PyQt5.QtWidgets.QGraphicsLineItem import __init__ [as 別名]
def __init__(self, startNode, endNode):
QGraphicsLineItem.__init__(self)
self.setPen(QPen())
self.startNode = startNode
self.endNode = endNode
self.startNode.addObserver(self)
startShape = self.startNode.mapToScene(self.startNode.shape())
p1 = closestPointTo(self.endNode, startShape)
self.setLine(QLineF(p1, self.endNode))
示例4: __init__
# 需要導入模塊: from PyQt5.QtWidgets import QGraphicsLineItem [as 別名]
# 或者: from PyQt5.QtWidgets.QGraphicsLineItem import __init__ [as 別名]
def __init__(self, source, dest):
# Parent constructor(s)
QGraphicsLineItem.__init__(self)
self.source = source
self.dest = dest
示例5: __init__
# 需要導入模塊: from PyQt5.QtWidgets import QGraphicsLineItem [as 別名]
# 或者: from PyQt5.QtWidgets.QGraphicsLineItem import __init__ [as 別名]
def __init__(self, x1, y1, x2, y2, parent=None):
QGraphicsLineItem.__init__(self, x1, y1, x2, y2, parent)
self.setAcceptHoverEvents(True)