Pyqt QApplication.processEvents() 防止页面锁死

    def autoSubmitCloseOrder(self):
        if self.ib is not None:
            second = 0
            while True:
                QApplication.processEvents()
                self.ib.sleep(0.1)
                second += 1
                if second % 10 == 0:
                    print(datetime.datetime.now())

用QApplication.processEvents(),可以用在while 里,还是会去执行UI,不会导致页面锁死

http://www.waitingfy.com/archives/5430

5430

One Response to Pyqt QApplication.processEvents() 防止页面锁死

  1. […] 用QApplication.processEvents(),可以用在while 里,还是会去执行UI,不会导致页面锁死 http://www.waitingfy.com/archives/5430 […]

Leave a Reply

Name and Email Address are required fields.
Your email will not be published or shared with third parties.