本文整理汇总了Python中PyQt4.QtGui.QGraphicsPathItem.itemChange方法的典型用法代码示例。如果您正苦于以下问题:Python QGraphicsPathItem.itemChange方法的具体用法?Python QGraphicsPathItem.itemChange怎么用?Python QGraphicsPathItem.itemChange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QGraphicsPathItem
的用法示例。
在下文中一共展示了QGraphicsPathItem.itemChange方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: itemChange
# 需要导入模块: from PyQt4.QtGui import QGraphicsPathItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsPathItem import itemChange [as 别名]
def itemChange(self, change, value):
if change == QGraphicsPathItem.ItemSelectedHasChanged:
if value.toBool():
self.setZValue(self.zValue() + 1)
else:
self.setZValue(self.zValue() - 1)
return QGraphicsPathItem.itemChange(self, change, value)
示例2: itemChange
# 需要导入模块: from PyQt4.QtGui import QGraphicsPathItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsPathItem import itemChange [as 别名]
def itemChange(self, change, value):
if change == QGraphicsPathItem.ItemSelectedHasChanged:
self.setZValue(self.zValue() + (1 if value else -1))
return QGraphicsPathItem.itemChange(self, change, value)
示例3: itemChange
# 需要导入模块: from PyQt4.QtGui import QGraphicsPathItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsPathItem import itemChange [as 别名]
def itemChange(self, change, value):
if change == QGraphicsItem.ItemSelectedHasChanged:
self.setPen(QPen(Qt.red if self.isSelected() else Qt.blue, 2))
return QGraphicsPathItem.itemChange(self, change, value)
示例4: itemChange
# 需要导入模块: from PyQt4.QtGui import QGraphicsPathItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsPathItem import itemChange [as 别名]
def itemChange(self, change, value):
if change == QGraphicsItem.ItemEnabledHasChanged:
# Update the pen style
self.__update()
return QGraphicsPathItem.itemChange(self, change, value)