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


Python QGraphicsItem.mousePressEvent方法代码示例

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

示例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)
开发者ID:iras,项目名称:JADE,代码行数:12,代码来源:Tags0.py

示例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()
开发者ID:REC17,项目名称:cadnano2,代码行数:13,代码来源:activeslicehandle.py

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

示例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)
开发者ID:REC17,项目名称:cadnano2,代码行数:18,代码来源:precrossoverhandle.py

示例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)
开发者ID:mike-perdide,项目名称:gitbuster,代码行数:7,代码来源:graphics.py


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