本文整理汇总了Python中PyQt4.QtGui.QGraphicsItem.mousePressEvent方法的典型用法代码示例。如果您正苦于以下问题:Python QGraphicsItem.mousePressEvent方法的具体用法?Python QGraphicsItem.mousePressEvent怎么用?Python QGraphicsItem.mousePressEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QGraphicsItem
的用法示例。
在下文中一共展示了QGraphicsItem.mousePressEvent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mousePressEvent
# 需要导入模块: from PyQt4.QtGui import QGraphicsItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsItem import mousePressEvent [as 别名]
def mousePressEvent (self, e):
self.harpoon.setInitPos (self.pos()+self.parent.pos())
self.harpoon.setVisible (True)
self.harpoon.update ()
QGraphicsItem.mousePressEvent (self, e)
示例2: mousePressEvent
# 需要导入模块: from PyQt4.QtGui import QGraphicsItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsItem import mousePressEvent [as 别名]
def mousePressEvent (self, e):
#self.setAcceptedMouseButtons(Qt.NoButton)
self.previousMouseGrabberItem = self.scene.mouseGrabberItem()
if e.button() == Qt.RightButton:
pos = self.pos()
self.comm.emitCtxMenuSignal (pos)
QGraphicsItem.mousePressEvent (self, e)
示例3: mousePressEvent
# 需要导入模块: from PyQt4.QtGui import QGraphicsItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsItem import mousePressEvent [as 别名]
def mousePressEvent(self, event):
if event.button() != Qt.LeftButton:
event.ignore()
QGraphicsItem.mousePressEvent(self, event)
return
if not self.controller().isSelectToolActive():
return
self.scene().views()[0].addToPressList(self)
self._dragMode = True
self.pressX = event.scenePos().x()
self.pressBaseIdx = self.activeSlice()
示例4: mousePressEvent
# 需要导入模块: from PyQt4.QtGui import QGraphicsItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsItem import mousePressEvent [as 别名]
def mousePressEvent(self, event):
pos = event.pos()
x = pos.x()
y = pos.y()
if self.on_search:
self.updateCursor(x, y, True)
event.accept()
return
elif self.on_template:
self.updateCursor(x, y, False)
event.accept()
return
QGraphicsItem.mousePressEvent(self, event)
示例5: mousePressEvent
# 需要导入模块: from PyQt4.QtGui import QGraphicsItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsItem import mousePressEvent [as 别名]
def mousePressEvent(self, event):
if event.button() != Qt.LeftButton:
return QGraphicsItem.mousePressEvent(self, event)
if not self.couldFormNewCrossover():
return
# Determine upstream base
fromHelix, toHelix = self.fromVH, self.toVH
fromIdx, toIdx = self.fromIdx, self.toIdx
if not self.is3pEndOfCrossover():
fromHelix, toHelix = toHelix, fromHelix
fromIdx, toIdx = toIdx, fromIdx
# Create XoverHandlePair and store references
# fromHelix.installXoverFrom3To5(StrandType.Scaffold, \
# fromIndex, toHelix, toIndex)
fromHelix.installXoverFrom3To5(self.fromStrand, \
fromIdx, toHelix, toIdx)
示例6: mousePressEvent
# 需要导入模块: from PyQt4.QtGui import QGraphicsItem [as 别名]
# 或者: from PyQt4.QtGui.QGraphicsItem import mousePressEvent [as 别名]
def mousePressEvent(self, event):
QGraphicsItem.mousePressEvent(self, event)
self.being_moved = True
self.setZValue(100)
self.setCursor(Qt.ClosedHandCursor)