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


Python QGraphicsItem.itemChange方法代码示例

本文整理汇总了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)
开发者ID:REC17,项目名称:cadnano2,代码行数:19,代码来源:pathhelixhandle.py

示例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)
开发者ID:BackupTheBerlios,项目名称:simuvis4-svn,代码行数:10,代码来源:Items.py

示例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)
开发者ID:bizagwira,项目名称:random_topology,代码行数:10,代码来源:Node.py

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


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