當前位置: 首頁>>代碼示例>>Python>>正文


Python QtGui.QApplication方法代碼示例

本文整理匯總了Python中pyqtgraph.Qt.QtGui.QApplication方法的典型用法代碼示例。如果您正苦於以下問題:Python QtGui.QApplication方法的具體用法?Python QtGui.QApplication怎麽用?Python QtGui.QApplication使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pyqtgraph.Qt.QtGui的用法示例。


在下文中一共展示了QtGui.QApplication方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: update

# 需要導入模塊: from pyqtgraph.Qt import QtGui [as 別名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 別名]
def update():
     
    dataOk = 0
    global detObj
    x = []
    y = []
      
    # Read and parse the received data
    dataOk, frameNumber, detObj = readAndParseData16xx(Dataport, configParameters)
    
    if dataOk and len(detObj["x"])>0:
        #print(detObj)
        x = -detObj["x"]
        y = detObj["y"]
        
        s.setData(x,y)
        QtGui.QApplication.processEvents()
    
    return dataOk


# -------------------------    MAIN   -----------------------------------------  

# Configurate the serial port 
開發者ID:ibaiGorordo,項目名稱:AWR1642-Read-Data-Python-MMWAVE-SDK-2,代碼行數:26,代碼來源:readData_AWR1642.py

示例2: update

# 需要導入模塊: from pyqtgraph.Qt import QtGui [as 別名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 別名]
def update():
     
    dataOk = 0
    global vitalSignsObj, heartRateMat, frameMat
      
    # Read and parse the received data
    dataOk, frameNumber, vitalSignsObj = readAndParseVitalSigns(Dataport, configParameters)
    
    if dataOk:
        #print(vitalSignsObj)
        frameMat.append(frameNumber)
        heartRateMat.append(vitalSignsObj["heartRateEst_FFT"])
        
        s.setData(frameMat,heartRateMat)
        QtGui.QApplication.processEvents()
    
    return dataOk


# -------------------------    MAIN   -----------------------------------------  

# Configurate the serial port 
開發者ID:ibaiGorordo,項目名稱:AWR1642-Read-Data-Python-MMWAVE-SDK-2,代碼行數:24,代碼來源:DriverVitalSignsLab.py

示例3: update_stats

# 需要導入模塊: from pyqtgraph.Qt import QtGui [as 別名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 別名]
def update_stats(text):
    _window_stats_label.setText(text)

#    
#def start(sleep_s):
#    global _app, _update_timer
#    print('gui.start')
#    if update != None:
#        print('gui | Starting Update')
#        _update_timer = QtCore.QTimer()
#        _update_timer.timeout.connect(update)
#        _update_timer.start(sleep_s * 1000)
#    
#    print('gui | Starting QApplication')
#    _app.exec_()
#    
# 
開發者ID:memo,項目名稱:webcam-pix2pix-tensorflow,代碼行數:19,代碼來源:gui.py

示例4: run

# 需要導入模塊: from pyqtgraph.Qt import QtGui [as 別名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 別名]
def run(self):
        app = QtGui.QApplication([])
        ## Create window with GraphicsView widget
        win = pg.GraphicsLayoutWidget()
        win.show()  ## show widget alone in its own window
        win.setWindowTitle('pyqtgraph example: ImageItem')
        view = win.addViewBox()

        ## lock the aspect ratio so pixels are always square
        view.setAspectLocked(True)

        ## Create image item
        self.img = pg.ImageItem(border='w')
        view.addItem(self.img)

        ## Set initial view bounds
        view.setRange(QtCore.QRectF(0, 0, 2*self.image_hw, self.image_hw))

        timer = QtCore.QTimer()
        timer.timeout.connect(self._update)
        timer.start(50)

        app.exec_() 
開發者ID:udacity,項目名稱:RoboND-DeepLearning-Project,代碼行數:25,代碼來源:visualization.py

示例5: close

# 需要導入模塊: from pyqtgraph.Qt import QtGui [as 別名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 別名]
def close(self):
        timediff = datetime.datetime.now() - self.creation_time
        self.close_stream()
        if self.save_data and self.pcounter > 0:
            print("Saving data to file...")
            #print(self.df.to_string)
            td_str = '-'.join(str(timediff).split(':')[:2])
            _ = self.df.to_pickle(DATA_FOLDER + self.creation_time.strftime("/pulses_%Y-%m-%d_%H-%M-%S") + "___" + str(self.pcounter) + "___" + td_str + ".pkl")
            print("Saving completed.")
            print()
            print('Number of recorded waveforms:', self.pcounter, "of",self.frame_counter, "total audio frames")
            print('at least', len(self.df[self.df['ptype'] == 'alpha']) ,"alphas and") 
            print('at least', len(self.df[self.df['ptype'] == 'beta']) ,"electrons/betas were detected") 
        self.p.terminate()
        app = QtGui.QApplication([])
        app.closeAllWindows()
        app.quit()
        app.exit()
        print('done.') 
開發者ID:ozel,項目名稱:DIY_particle_detector,代碼行數:21,代碼來源:pulse_recorder.py

示例6: __init__

# 需要導入模塊: from pyqtgraph.Qt import QtGui [as 別名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 別名]
def __init__(self):
        """
        Initialize the graphics window and mesh surface
        """

        # setup the view window
        self.app = QtGui.QApplication(sys.argv)
        self.window = gl.GLViewWidget()
        self.window.setWindowTitle('Terrain')
        self.window.setGeometry(0, 110, 1920, 1080)
        self.window.setCameraPosition(distance=30, elevation=12)
        self.window.show()

        gx = gl.GLGridItem()
        gy = gl.GLGridItem()
        gz = gl.GLGridItem()
        gx.rotate(90, 0, 1, 0)
        gy.rotate(90, 1, 0, 0)
        gx.translate(-10, 0, 0)
        gy.translate(0, -10, 0)
        gz.translate(0, 0, -10)
        self.window.addItem(gx)
        self.window.addItem(gy)
        self.window.addItem(gz)

        model = 'mobilenet_thin_432x368'
        camera = 0
        w, h = model_wh(model)
        self.e = TfPoseEstimator(get_graph_path(model), target_size=(w, h))
        self.cam = cv2.VideoCapture("C:\\Users\\velpu\\Desktop\\tf-pose\dance.mp4")
        ret_val, image = self.cam.read()
        self.poseLifting = Prob3dPose('./src/lifting/models/prob_model_params.mat')
        keypoints = self.mesh(image)

        self.points = gl.GLScatterPlotItem(
            pos=keypoints,
            color=pg.glColor((0, 255, 0)),
            size=15
        )
        self.window.addItem(self.points) 
開發者ID:SrikanthVelpuri,項目名稱:tf-pose,代碼行數:42,代碼來源:webcam3d.py

示例7: start

# 需要導入模塊: from pyqtgraph.Qt import QtGui [as 別名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 別名]
def start(self):
        """
        get the graphics window open and setup
        """
        if (sys.flags.interactive != 1) or not hasattr(QtCore, 'PYQT_VERSION'):
            QtGui.QApplication.instance().exec_() 
開發者ID:SrikanthVelpuri,項目名稱:tf-pose,代碼行數:8,代碼來源:webcam3d.py

示例8: run

# 需要導入模塊: from pyqtgraph.Qt import QtGui [as 別名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 別名]
def run():
    app = QtGui.QApplication([])
    loader = ExampleLoader()

    app.exec_() 
開發者ID:SrikanthVelpuri,項目名稱:tf-pose,代碼行數:7,代碼來源:__main__.py

示例9: mouseDoubleClickEvent

# 需要導入模塊: from pyqtgraph.Qt import QtGui [as 別名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 別名]
def mouseDoubleClickEvent(self, event, *args, **kwargs):
        print('label double clicked')
        self.win = CurveModifyWin(self.id, self.mainwindow)
        self.win.sigCurveChanged.connect(self.callback_sigchanged)
        self.win.show()
        QtGui.QApplication.processEvents()
        time.sleep(0.2) 
開發者ID:Marxlp,項目名稱:pyFlightAnalysis,代碼行數:9,代碼來源:widgets.py

示例10: _translate

# 需要導入模塊: from pyqtgraph.Qt import QtGui [as 別名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 別名]
def _translate(context,  text,  disambig):
        return QtGui.QApplication.translate(context,  text,  disambig,  _encoding) 
開發者ID:Marxlp,項目名稱:pyFlightAnalysis,代碼行數:4,代碼來源:analysis.py

示例11: show_curve_property_diag

# 需要導入模塊: from pyqtgraph.Qt import QtGui [as 別名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 別名]
def show_curve_property_diag(id, parent):
    def func(event):
        print('curve was double clicked')
        print(event)
        win = CurveModifyWin(id, parent)
        win.show()
        QtGui.QApplication.processEvents()
        print('end')
        
    return func 
開發者ID:Marxlp,項目名稱:pyFlightAnalysis,代碼行數:12,代碼來源:analysis.py

示例12: main

# 需要導入模塊: from pyqtgraph.Qt import QtGui [as 別名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 別名]
def main():
    def func():
        print(app.focusWidget())
    app = QtGui.QApplication(sys.argv)
    app.focusChanged.connect(func)
    mainwin = MainWindow()
    mainwin.show()
    print(app.focusWidget())
    sys.exit(app.exec_()) 
開發者ID:Marxlp,項目名稱:pyFlightAnalysis,代碼行數:11,代碼來源:analysis.py

示例13: view_batch

# 需要導入模塊: from pyqtgraph.Qt import QtGui [as 別名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 別名]
def view_batch(*args, width=300, height=300, lut={}):
    use_these = args
    if not isinstance(use_these, (np.ndarray, np.memmap)):
        use_these = list(use_these)
        for i in range(len(use_these)):
            item = use_these[i]
            try:
                import torch
                if isinstance(item, torch.Tensor):
                    item = item.detach().cpu().numpy()
            except ImportError:
                pass
            while len(item.shape) < 4:
                item = item[None]
            use_these[i] = item
        use_these = np.concatenate(use_these, 0)
    else:
        while len(use_these.shape) < 4:
            use_these = use_these[None]

    global app
    app = QtGui.QApplication.instance()
    if app is None:
        app = QtGui.QApplication(sys.argv)
    sv = BatchViewer(width=width, height=height)
    sv.setBatch(use_these, lut)
    sv.show()
    app.exit(app.exec_()) 
開發者ID:FabianIsensee,項目名稱:BatchViewer,代碼行數:30,代碼來源:batchviewer.py

示例14: main

# 需要導入模塊: from pyqtgraph.Qt import QtGui [as 別名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 別名]
def main():
    app = QtGui.QApplication([])
    win = PicoPyScope(app)
    win.show()
    # debug = pg.dbg()
    try:
        sys.exit(app.exec_())
    except Exception as ex:
        print "main:", ex.message 
開發者ID:picotech,項目名稱:picosdk-python-examples,代碼行數:11,代碼來源:picopyscope.py

示例15: update

# 需要導入模塊: from pyqtgraph.Qt import QtGui [as 別名]
# 或者: from pyqtgraph.Qt.QtGui import QApplication [as 別名]
def update():
     
    dataOk = 0
    targetDetected = 0
    global targetObj
    global pointObj
    x = []
    y = []
      
    # Read and parse the received data
    dataOk, targetDetected, frameNumber, targetObj, pointObj = readAndParseData16xx(Dataport, configParameters)
    
    if targetDetected:
        print(targetObj)
        print(targetObj["numTargets"])
        x = -targetObj["posX"]
        y = targetObj["posY"]
        s2.setData(x,y)
        QtGui.QApplication.processEvents()
        
    if dataOk: 
        x = -pointObj["range"]*np.sin(pointObj["azimuth"])
        y = pointObj["range"]*np.cos(pointObj["azimuth"])
        
        s1.setData(x,y)
        QtGui.QApplication.processEvents()
    
    return dataOk


# -------------------------    MAIN   -----------------------------------------  

# Configurate the serial port 
開發者ID:ibaiGorordo,項目名稱:AWR1642-Read-Data-Python-MMWAVE-SDK-2,代碼行數:35,代碼來源:peopleCountingDemo.py


注:本文中的pyqtgraph.Qt.QtGui.QApplication方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。