本文整理匯總了Python中MT.attachToBoundSignal方法的典型用法代碼示例。如果您正苦於以下問題:Python MT.attachToBoundSignal方法的具體用法?Python MT.attachToBoundSignal怎麽用?Python MT.attachToBoundSignal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MT
的用法示例。
在下文中一共展示了MT.attachToBoundSignal方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: import MT [as 別名]
# 或者: from MT import attachToBoundSignal [as 別名]
def __init__(self,
data,
parent=None,
options=True,
width=NodeDesigner.width,
height=NodeDesigner.height):
QGraphicsSvgItem.__init__(self, parent)
self.data = data
self._width = width
self.height = height
self.viewed = False
self._viewSockets = False
self._visibleSockets = []
self.setFlag(QGraphicsItem.ItemIsMovable, True)
self.setFlag(QGraphicsItem.ItemIsFocusable, True)
self.setFlag(QGraphicsItem.ItemIsSelectable, True)
self.setFlag(QGraphicsItem.ItemSendsGeometryChanges, True)
self.setAcceptHoverEvents(True)
self.setAcceptsHoverEvents(True)
self.setAcceptDrops(True)
self.nameBG = NodeNameBG(self)
self.name = NodeName(self)
self.nameBG._width = self.name.boundingRect().width()
self.nameBG.height = self.name.boundingRect().height()
self.out = []
pos = width;
colors = QColor()
altcolor = False
for out in self.data.outsockets:
vis = NodeOutSocket(self, out, altcolor)
altcolor = not altcolor
vis.setPos(QPoint(pos, 0))
pos += vis._width + 2 #slight margin
self.out.append(vis)
self.addsocketcb = MT.attachToBoundSignal(data, "outSocketAdded", self.newOutSocket)
if options:
self.nodeOptions = NodeOptionsButton(self)
self.posCB = MT.attachToBoundSignal(data, "nodePositionChanged", self.updatePositionFromData)