久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <small id='CFKzK'></small><noframes id='CFKzK'>

      <tfoot id='CFKzK'></tfoot>

      1. <i id='CFKzK'><tr id='CFKzK'><dt id='CFKzK'><q id='CFKzK'><span id='CFKzK'><b id='CFKzK'><form id='CFKzK'><ins id='CFKzK'></ins><ul id='CFKzK'></ul><sub id='CFKzK'></sub></form><legend id='CFKzK'></legend><bdo id='CFKzK'><pre id='CFKzK'><center id='CFKzK'></center></pre></bdo></b><th id='CFKzK'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='CFKzK'><tfoot id='CFKzK'></tfoot><dl id='CFKzK'><fieldset id='CFKzK'></fieldset></dl></div>
          <bdo id='CFKzK'></bdo><ul id='CFKzK'></ul>
        <legend id='CFKzK'><style id='CFKzK'><dir id='CFKzK'><q id='CFKzK'></q></dir></style></legend>

        Pyinstaller 和 PyQt5 macOS Mojave 兼容性問題

        Pyinstaller and PyQt5 macOS Mojave compatibility issues(Pyinstaller 和 PyQt5 macOS Mojave 兼容性問題)

      2. <legend id='fE561'><style id='fE561'><dir id='fE561'><q id='fE561'></q></dir></style></legend>
          <tbody id='fE561'></tbody>
            <i id='fE561'><tr id='fE561'><dt id='fE561'><q id='fE561'><span id='fE561'><b id='fE561'><form id='fE561'><ins id='fE561'></ins><ul id='fE561'></ul><sub id='fE561'></sub></form><legend id='fE561'></legend><bdo id='fE561'><pre id='fE561'><center id='fE561'></center></pre></bdo></b><th id='fE561'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='fE561'><tfoot id='fE561'></tfoot><dl id='fE561'><fieldset id='fE561'></fieldset></dl></div>
            <tfoot id='fE561'></tfoot>

                • <bdo id='fE561'></bdo><ul id='fE561'></ul>

                  <small id='fE561'></small><noframes id='fE561'>

                • 本文介紹了Pyinstaller 和 PyQt5 macOS Mojave 兼容性問題的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  在我從 High Sierra 升級到 Mojave 之前,我使用 Pyinstaller 創建的應用程序運行良好.為了演示這個問題,我創建了一個簡單的應用程序.主窗口只有一個按鈕.當您按下按鈕時,其文本應更改為請稍候"10 秒鐘.當我將此程序作為 .py 腳本運行時,一切正常,但在使用 Pyinstaller 創建 .app 文件后,它的行為會有所不同.在您單擊窗口外的任何位置之前,文本不會更新.

                  My application, created with Pyinstaller, worked fine until I upgraded from High Sierra to Mojave. In order to demonstrate the issue I create the simple application. Main window has only one button. When you press the button its text should be changed to "Please wait" for 10 seconds. When I run this program as .py script, everything works fine, but after creating .app file with Pyinstaller it behaves differently. The text is not updated until you click anywhere outside of the window.

                  我嘗試重新安裝 Pyinstaller,但問題仍然存在.

                  I tried to reinstall Pyinstaller, but the problem still exists.

                  from PyQt5 import QtCore, QtGui, QtWidgets
                  import time
                  
                  class Ui_MainWindow(object):
                      def setupUi(self, MainWindow):
                          MainWindow.setObjectName("MainWindow")
                          MainWindow.resize(303, 304)
                          self.centralwidget = QtWidgets.QWidget(MainWindow)
                          self.centralwidget.setObjectName("centralwidget")
                          self.label = QtWidgets.QLabel(self.centralwidget)
                          self.label.setGeometry(QtCore.QRect(50, 80, 300, 43))
                          self.pushButton = QtWidgets.QPushButton(self.centralwidget)
                          self.pushButton.setGeometry(QtCore.QRect(80, 170, 113, 32))
                          self.pushButton.setObjectName("pushButton")
                          self.pushButton.setDefault(True)
                          MainWindow.setCentralWidget(self.centralwidget)
                  
                          self.retranslateUi(MainWindow)
                          QtCore.QMetaObject.connectSlotsByName(MainWindow)
                  
                          self.pushButton.clicked.connect(self.click)
                          self.thread = Thread()
                          self.thread.finished.connect(lambda: self.pushButton.setEnabled(True))
                  
                  
                      def retranslateUi(self, MainWindow):
                          _translate = QtCore.QCoreApplication.translate
                          MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
                          self.pushButton.setText(_translate("MainWindow", "Click me"))
                  
                  
                      def click(self):
                          if not self.thread.isRunning():
                              self.pushButton.setEnabled(False)
                              self.pushButton.setText("Please wait")
                              self.label.setText("The button below should display 
                   'Please wait' for 10 seconds")
                              self.thread.start()
                  
                  class Thread(QtCore.QThread):
                      def run(self):
                  
                          time.sleep(10)
                          ui.pushButton.setEnabled(False)
                          ui.pushButton.setText("Click me") 
                          ui.label.setText("")
                  
                  
                  
                  if __name__ == "__main__":
                      import sys
                      app = QtWidgets.QApplication(sys.argv)
                      MainWindow = QtWidgets.QMainWindow()
                      ui = Ui_MainWindow()
                      ui.setupUi(MainWindow)
                      MainWindow.show()
                      sys.exit(app.exec_())
                  

                  推薦答案

                  我找到了我的問題的答案.為了解決這個渲染問題,您需要為需要更新的 ui 元素添加以下行.就我而言,僅當我需要在 macOS Mojave 上運行此應用程序時才需要它.

                  I found an answer to my question. In order to solve this rendering issue you need to add the following line for a ui element, which needs to be updated. In my case it is required only if I need to run this application on macOS Mojave.

                  <element>.repaint()

                  例如:

                  def click(self):             
                          self.pushButton.setEnabled(False)
                          self.pushButton.setText("Button is clicked...")
                          self.pushButton.repaint()
                  

                  這篇關于Pyinstaller 和 PyQt5 macOS Mojave 兼容性問題的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  How to bind a function to an Action from Qt menubar?(如何將函數綁定到 Qt 菜單欄中的操作?)
                  PyQt progress jumps to 100% after it starts(PyQt 啟動后進度躍升至 100%)
                  How to set yaxis tick label in a fixed position so that when i scroll left or right the yaxis tick label should be visible?(如何將 yaxis 刻度標簽設置在固定位置,以便當我向左或向右滾動時,yaxis 刻度標簽應該可見
                  `QImage` constructor has unknown keyword `data`(`QImage` 構造函數有未知關鍵字 `data`)
                  Change x-axis ticks to custom strings(將 x 軸刻度更改為自定義字符串)
                  How to show progress bar while saving file to excel in python?(如何在python中將文件保存為excel時顯示進度條?)
                • <legend id='3b2J2'><style id='3b2J2'><dir id='3b2J2'><q id='3b2J2'></q></dir></style></legend>

                  • <i id='3b2J2'><tr id='3b2J2'><dt id='3b2J2'><q id='3b2J2'><span id='3b2J2'><b id='3b2J2'><form id='3b2J2'><ins id='3b2J2'></ins><ul id='3b2J2'></ul><sub id='3b2J2'></sub></form><legend id='3b2J2'></legend><bdo id='3b2J2'><pre id='3b2J2'><center id='3b2J2'></center></pre></bdo></b><th id='3b2J2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='3b2J2'><tfoot id='3b2J2'></tfoot><dl id='3b2J2'><fieldset id='3b2J2'></fieldset></dl></div>
                      <bdo id='3b2J2'></bdo><ul id='3b2J2'></ul>

                      • <small id='3b2J2'></small><noframes id='3b2J2'>

                      • <tfoot id='3b2J2'></tfoot>

                              <tbody id='3b2J2'></tbody>
                            主站蜘蛛池模板: 91久久久久久 | 国产剧情一区二区三区 | 日韩在线视频观看 | 欧美激情亚洲激情 | 91久久精品视频 | 91视频官网 | 国产美女视频黄a视频免费 国产精品福利视频 | 欧美一区二区激情三区 | 婷婷中文在线 | 日本三级全黄三级三级三级口周 | 久草免费在线视频 | 在线成人一区 | 一区二区三区高清 | 自拍在线 | www国产成人免费观看视频,深夜成人网 | 欧美二级| 久久久久久一区 | 久久精品aaa| 综合久久久| 久久久精品一区二区三区 | 欧美日韩亚洲国产 | 欧美日韩视频在线 | 亚洲人成人一区二区在线观看 | 成人九色 | 国产精品a久久久久 | 亚洲精品乱码久久久久久按摩观 | 欧美人人 | 国产免费一区二区 | 成人国产精品久久久 | 99国产精品久久久久老师 | 欧美中文一区 | www.久久.com | 午夜久久久久久久久久一区二区 | 欧美一区二区三区在线免费观看 | 亚洲成av人片在线观看无码 | 在线观看av网站永久 | 男女一区二区三区 | 美女天堂在线 | 日韩精品免费在线 | 国产日韩欧美一区 | 色av一区二区 |