我创建了一个小代码,它可以让我回到鼠标按下时光标下面的窗口。但是,我也在生成多个
子图,通过调用addPlot
。有没有办法返回图形(子图)
按下鼠标时是否在光标下?
from PySide.QtGui import (QApplication, QMainWindow, QFileDialog)
import pyqtgraph as pg
class MyGraphWindow(pg.GraphicsLayoutWidget):
def __init__(self, mainwindow):
super(MyGraphWindow, self).__init__()
self.mainwindow = mainwindow
def mousePressEvent(self, ev):
log.debug("%r", ev)
self.mainwindow.window_activated(self)
return super(MyGraphWindow, self).mousePressEvent(ev)