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


Python QtGui.QMainWindow方法代码示例

本文整理汇总了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) 
开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:29,代码来源:__main__.py

示例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) 
开发者ID:Marxlp,项目名称:pyFlightAnalysis,代码行数:4,代码来源:widgets.py

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

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

示例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() 
开发者ID:portugueslab,项目名称:stytra,代码行数:16,代码来源:metadata_reader.py

示例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) 
开发者ID:seanwood,项目名称:gcc-nmf,代码行数:36,代码来源:gccNMFInterface.py

示例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() 
开发者ID:picotech,项目名称:picosdk-python-examples,代码行数:63,代码来源:picopyscope.py


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