本文整理匯總了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)