本文整理汇总了Python中pyqtgraph.Qt.QtGui.QMainWindow方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QMainWindow方法的具体用法?Python QtGui.QMainWindow怎么用?Python QtGui.QMainWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyqtgraph.Qt.QtGui
的用法示例。
在下文中一共展示了QtGui.QMainWindow方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QMainWindow [as 别名]
def __init__(self):
QtGui.QMainWindow.__init__(self)
self.ui = Ui_Form()
self.cw = QtGui.QWidget()
self.setCentralWidget(self.cw)
self.ui.setupUi(self.cw)
self.codeBtn = QtGui.QPushButton('Run Edited Code')
self.codeLayout = QtGui.QGridLayout()
self.ui.codeView.setLayout(self.codeLayout)
self.codeLayout.addItem(QtGui.QSpacerItem(100,100,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Expanding), 0, 0)
self.codeLayout.addWidget(self.codeBtn, 1, 1)
self.codeBtn.hide()
global examples
self.itemCache = []
self.populateTree(self.ui.exampleTree.invisibleRootItem(), examples)
self.ui.exampleTree.expandAll()
self.resize(1000,500)
self.show()
self.ui.splitter.setSizes([250,750])
self.ui.loadBtn.clicked.connect(self.loadFile)
self.ui.exampleTree.currentItemChanged.connect(self.showFile)
self.ui.exampleTree.itemDoubleClicked.connect(self.loadFile)
self.ui.codeView.textChanged.connect(self.codeEdited)
self.codeBtn.clicked.connect(self.runEditedCode)
示例2: closeEvent
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QMainWindow [as 别名]
def closeEvent(self, *args, **kwargs):
return QtGui.QMainWindow.closeEvent(self, *args, **kwargs)
示例3: keyPressEvent
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QMainWindow [as 别名]
def keyPressEvent(self, event, *args, **kwargs):
print(event)
if event.key() == QtCore.Qt.Key_S:
print('S pressed')
if self.splitter1.isHidden():
self.splitter1.show()
else:
self.splitter1.hide()
elif event.key() == QtCore.Qt.Key_D:
print('D pressed')
for curve in self.curve_highlighted:
del(curve)
return QtGui.QMainWindow.keyPressEvent(self, event, *args, **kwargs)
示例4: closeEvent
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QMainWindow [as 别名]
def closeEvent(self, *args, **kwargs):
if self.analysis_graphs_showed:
self.analysis_graphs_pane.close()
if self.params_pane_showed:
self.params_pane.close()
if self.info_pane_showed:
self.info_pane.close()
if self.help_pane_showed:
pass
return QtGui.QMainWindow.closeEvent(self, *args, **kwargs)
示例5: image_viewer
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QMainWindow [as 别名]
def image_viewer(self):
"""Open metadata image in the Image Viewer from PyQtGraph.
"""
self.win = QtGui.QMainWindow()
self.win.resize(800, 800)
self.fignp = np.array(Image.open(io.BytesIO(self.figbytes)))
self.fignp = np.swapaxes(self.fignp, 0, 1)
self.imv = pg.ImageView()
self.imv.setImage(self.fignp)
self.win.setCentralWidget(self.imv)
self.win.setWindowTitle("Metadata Image")
self.win.show()
示例6: keyPressEvent
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QMainWindow [as 别名]
def keyPressEvent(self, event):
key = event.key()
if key == QtCore.Qt.Key_Escape:
if self.isFullScreen():
self.showNormal()
else:
self.close()
if key == QtCore.Qt.Key_W and QtGui.QApplication.keyboardModifiers() == QtCore.Qt.ControlModifier:
self.close()
elif key == QtCore.Qt.Key_Return or key == QtCore.Qt.Key_Enter or key == QtCore.Qt.Key_Space:
self.togglePlay()
elif key == QtCore.Qt.Key_F and QtGui.QApplication.keyboardModifiers() == QtCore.Qt.ControlModifier:
if self.isFullScreen():
self.showNormal()
#self.showMaximized()
else:
self.showFullScreen()
elif key == QtCore.Qt.Key_I and QtGui.QApplication.keyboardModifiers() == QtCore.Qt.ControlModifier:
self.toggleInfoViews()
elif key == QtCore.Qt.Key_1 and QtGui.QApplication.keyboardModifiers() == QtCore.Qt.ControlModifier:
self.inputSpectrogramWidget.setVisible(self.inputSpectrogramWidget.isHidden())
elif key == QtCore.Qt.Key_2 and QtGui.QApplication.keyboardModifiers() == QtCore.Qt.ControlModifier:
self.outputSpectrogramWidget.setVisible(self.outputSpectrogramWidget.isHidden())
elif key == QtCore.Qt.Key_3 and QtGui.QApplication.keyboardModifiers() == QtCore.Qt.ControlModifier:
self.dictionaryWidget.setVisible(self.dictionaryWidget.isHidden())
elif key == QtCore.Qt.Key_4 and QtGui.QApplication.keyboardModifiers() == QtCore.Qt.ControlModifier:
self.coefficientMaskWidget.setVisible(self.coefficientMaskWidget.isHidden())
elif key == QtCore.Qt.Key_5 and QtGui.QApplication.keyboardModifiers() == QtCore.Qt.ControlModifier:
self.gccPHATHistoryWidget.setVisible(self.gccPHATHistoryWidget.isHidden())
elif key == QtCore.Qt.Key_0 and QtGui.QApplication.keyboardModifiers() == QtCore.Qt.ControlModifier:
self.rollingImages = not self.rollingImages
super(QtGui.QMainWindow, self).keyPressEvent(event)
示例7: __init__
# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QMainWindow [as 别名]
def __init__(self, app):
QtGui.QMainWindow.__init__(self)
self.app = app
self.currentDevice = None
self.lastSegment = 0
self.currentSegment = 0
self.maxSegments = 4
self.segments = self.maxSegments
self.interval = None
self.lastInterval = 0
self.lastTimebase = 0
self.lastRatio = 1
self.lastYValue = None
self.minSamples = 100
self.maxSamples = 100000
self.samples = self.maxSamples
self.maxRange = 0
self.maxRangeUpdate = False
self.triggX = None
self.triggY = None
self.triggerReset = False
self.triggerDiamond = None
self.cpss = 0
self.cpsc = 0
self.timebaseKnobTimeRightIndex = 0
self.timebaseKnobTimeLeftIndex = 0
self.timebaseRatioMode = PicoPyRatioModes.raw
self.timebaseRatioReset = True
self.ratioMode = 0
self.ratioBin = 1
self.eventExit = th.Event()
self.eventExit.clear()
self.eventDataNeeded = th.Event()
self.eventDataNeeded.clear()
self.eventDataReady = th.Event()
self.eventDataReady.clear()
self.eventSiggenUpdate = th.Event()
self.eventSiggenUpdate.clear()
self.enumDeviceThread = None
self.selectDeviceThread = None
self.collectDataThread = None
self.plotDataThread = None
self.sigGenThread = None
self.selectDeviceWorker = None
self.driverAccessLock = th.Lock()
self.plotLock = th.Lock()
self.drivers = {"ps2000": PicoPyDriver("ps2000"),
"ps2000a": PicoPyDriver("ps2000a"),
"ps3000": PicoPyDriver("ps3000"),
"ps3000a": PicoPyDriver("ps3000a"),
"ps4000": PicoPyDriver("ps4000"),
"ps4000a": PicoPyDriver("ps4000a"),
"ps5000a": PicoPyDriver("ps5000a"),
"ps6000": PicoPyDriver("ps6000")}
self._initUI()
self._initWorkers()