本文整理汇总了Python中PyQt4.QtGui.QGraphicsItem.itemChange方法的典型用法代码示例。如果您正苦于以下问题:Python QGraphicsItem.itemChange方法的具体用法?Python QGraphicsItem.itemChange怎么用?Python QGraphicsItem.itemChange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QGraphicsItem
的用法示例。
在下文中一共展示了QGraphicsItem.itemChange方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: itemChange
# 需要导入模块: from PyQt4.QtGui import QGraphicsItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsItem import itemChange [as 别名]
def itemChange(self, change, value):
# for selection changes test against QGraphicsItem.ItemSelectedChange
# intercept the change instead of the has changed to enable features.
# if change == QGraphicsItem.ItemSelectedHasChanged and self.scene():
if change == QGraphicsItem.ItemSelectedChange and self.scene():
selectionGroup = self.parent.phhSelectionGroup
lock = selectionGroup.parentItem().selectionLock
if value == True and (lock == None or lock == selectionGroup):
selectionGroup.addToGroup(self)
selectionGroup.parentItem().selectionLock = selectionGroup
return QGraphicsItem.itemChange(self, change, True)
# end if
else:
return QGraphicsItem.itemChange(self, change, False)
# end else
self.update(self.boundingRect())
return QGraphicsItem.itemChange(self, change, value)
示例2: itemChange
# 需要导入模块: from PyQt4.QtGui import QGraphicsItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsItem import itemChange [as 别名]
def itemChange(self, change, value):
if change == QGraphicsItem.ItemPositionChange:
if hasattr(self, '_edges'):
newp = value.toPointF()
for e, p in self._edges:
if p == 1: e.setLine(QLineF(newp, e.line().p2()))
elif p == 2: e.setLine(QLineF(e.line().p1(), newp))
return QGraphicsItem.itemChange(self, change, value)
示例3: itemChange
# 需要导入模块: from PyQt4.QtGui import QGraphicsItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsItem import itemChange [as 别名]
def itemChange(self, change, value):
if change == QGraphicsItem.ItemPositionChange :
point = value.toPointF()
self.pos[self.node] = [point.x(), point.y()]
self.scene.update()
self.m_signalLinkNode.nodeItemSignal.emit (self.node, self.pos[self.node])
return QGraphicsItem.itemChange(self, change, value)
示例4: itemChange
# 需要导入模块: from PyQt4.QtGui import QGraphicsItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsItem import itemChange [as 别名]
def itemChange(self, change, value):
if change == QGraphicsItem.ItemPositionChange:
pos = value.toPointF()
scene = self.scene()
if not self.changing and scene is not None:
self.changing = True
scene.templatePosChange.emit(pos)
self.changing = False
return QGraphicsItem.itemChange(self, change, value)