本文整理汇总了Python中pyqtgraph.Qt.QtCore方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.QtCore方法的具体用法?Python Qt.QtCore怎么用?Python Qt.QtCore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtgraph.Qt
的用法示例。
在下文中一共展示了Qt.QtCore方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mouseDragEvent
# 需要导入模块: from pyqtgraph import Qt [as 别名]
# 或者: from pyqtgraph.Qt import QtCore [as 别名]
def mouseDragEvent(self, ev):
if ev.button() != QtCore.Qt.LeftButton:
ev.ignore()
return
if ev.isStart():
# We are already one step into the drag.
# Find the point(s) at the mouse cursor when the button was first
# pressed:
pos = ev.buttonDownPos()
pts = self.scatter.pointsAt(pos)
if len(pts) == 0:
ev.ignore()
return
self.dragPoint = pts[0]
ind = pts[0].data()[0]
self.dragOffset = self.data['pos'][ind] - pos
elif ev.isFinish():
self.dragPoint = None
return
else:
if self.dragPoint is None:
ev.ignore()
return
ind = self.dragPoint.data()[0]
self.data['pos'][ind] = ev.pos() + self.dragOffset
self.updateGraph()
ev.accept()
示例2: mouseClickEvent
# 需要导入模块: from pyqtgraph import Qt [as 别名]
# 或者: from pyqtgraph.Qt import QtCore [as 别名]
def mouseClickEvent(self, ev):
if ev.button() == QtCore.Qt.RightButton:
self.autoRange()
示例3: mouseDragEvent
# 需要导入模块: from pyqtgraph import Qt [as 别名]
# 或者: from pyqtgraph.Qt import QtCore [as 别名]
def mouseDragEvent(self, ev):
if ev.button() == QtCore.Qt.RightButton:
ev.ignore()
else:
pg.ViewBox.mouseDragEvent(self, ev)