pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <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="v8v08ct" 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="txelsnt" 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 兼容性問題的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  在我從 High Sierra 升級(jí)到 Mojave 之前,我使用 Pyinstaller 創(chuàng)建的應(yīng)用程序運(yùn)行良好.為了演示這個(gè)問題,我創(chuàng)建了一個(gè)簡(jiǎn)單的應(yīng)用程序.主窗口只有一個(gè)按鈕.當(dāng)您按下按鈕時(shí),其文本應(yīng)更改為請(qǐng)稍候"10 秒鐘.當(dāng)我將此程序作為 .py 腳本運(yùn)行時(shí),一切正常,但在使用 Pyinstaller 創(chuàng)建 .app 文件后,它的行為會(huì)有所不同.在您單擊窗口外的任何位置之前,文本不會(huì)更新.

                  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_())
                  

                  推薦答案

                  我找到了我的問題的答案.為了解決這個(gè)渲染問題,您需要為需要更新的 ui 元素添加以下行.就我而言,僅當(dāng)我需要在 macOS Mojave 上運(yùn)行此應(yīng)用程序時(shí)才需要它.

                  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()
                  

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

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

                  相關(guān)文檔推薦

                  How to bind a function to an Action from Qt menubar?(如何將函數(shù)綁定到 Qt 菜單欄中的操作?)
                  PyQt progress jumps to 100% after it starts(PyQt 啟動(dòng)后進(jìn)度躍升至 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 刻度標(biāo)簽設(shè)置在固定位置,以便當(dāng)我向左或向右滾動(dòng)時(shí),yaxis 刻度標(biāo)簽應(yīng)該可見
                  `QImage` constructor has unknown keyword `data`(`QImage` 構(gòu)造函數(shù)有未知關(guān)鍵字 `data`)
                  Change x-axis ticks to custom strings(將 x 軸刻度更改為自定義字符串)
                  How to show progress bar while saving file to excel in python?(如何在python中將文件保存為excel時(shí)顯示進(jìn)度條?)
                • <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="34i08qp" 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>
                            主站蜘蛛池模板: (中山|佛山|江门)环氧地坪漆,停车场地板漆,车库地板漆,聚氨酯地板漆-中山永旺地坪漆厂家 | Magnescale探规,Magnescale磁栅尺,Magnescale传感器,Magnescale测厚仪,Mitutoyo光栅尺,笔式位移传感器-苏州连达精密量仪有限公司 | 谷歌关键词优化-外贸网站优化-Google SEO小语种推广-思亿欧外贸快车 | 深圳成考网-深圳成人高考报名网 深圳工程师职称评定条件及流程_深圳职称评审_职称评审-职称网 | 档案密集架,移动密集架,手摇式密集架,吉林档案密集架-厂家直销★价格公道★质量保证 | 药品冷藏箱厂家_低温冰箱_洁净工作台-济南欧莱博电子商务有限公司官网 | TPE_TPE热塑性弹性体_TPE原料价格_TPE材料厂家-惠州市中塑王塑胶制品公司- 中塑王塑胶制品有限公司 | 不锈钢列管式冷凝器,换热器厂家-无锡飞尔诺环境工程有限公司 | 挤奶设备过滤纸,牛奶过滤纸,挤奶机过滤袋-济南蓝贝尔工贸有限公司 | 无轨电动平车_轨道平车_蓄电池电动平车★尽在新乡百特智能转运设备有限公司 | 武汉天安盾电子设备有限公司 - 安盾安检,武汉安检门,武汉安检机,武汉金属探测器,武汉测温安检门,武汉X光行李安检机,武汉防爆罐,武汉车底安全检查,武汉液体探测仪,武汉安检防爆设备 | 温控器生产厂家-提供温度开关/热保护器定制与批发-惠州市华恺威电子科技有限公司 | Boden齿轮油泵-ketai齿轮泵-yuken油研-无锡新立液压有限公司 | 德国GMN轴承,GMN角接触球轴承,GMN单向轴承,GMN油封,GMN非接触式密封 | 广东机电安装工程_中央空调工程_东莞装饰装修-广东粤标建设有限公司 | 挤出机_橡胶挤出机_塑料挤出机_胶片冷却机-河北伟源橡塑设备有限公司 | 老房子翻新装修,旧房墙面翻新,房屋防水补漏,厨房卫生间改造,室内装潢装修公司 - 一修房屋快修官网 | 展厅设计-展馆设计-专业企业展厅展馆设计公司-昆明华文创意 | 淄博不锈钢,淄博不锈钢管,淄博不锈钢板-山东振远合金科技有限公司 | 并网柜,汇流箱,电控设备,中高低压开关柜,电气电力成套设备,PLC控制设备订制厂家,江苏昌伟业新能源科技有限公司 | 重庆私家花园设计-别墅花园-庭院-景观设计-重庆彩木园林建设有限公司 | 工业淬火油烟净化器,北京油烟净化器厂家,热处理油烟净化器-北京众鑫百科 | 机制砂选粉机_砂石选粉机厂家-盐城市助成粉磨科技有限公司 | 防爆电机_防爆电机型号_河南省南洋防爆电机有限公司 | CTAB,表面活性剂1631溴型(十六烷基三甲基溴化铵)-上海升纬化工原料有限公司 | 济南画室培训-美术高考培训-山东艺霖艺术培训画室 | 干洗加盟网-洗衣店品牌排行-干洗设备价格-干洗连锁加盟指南 | 玻璃钢格栅盖板|玻璃钢盖板|玻璃钢格栅板|树篦子-长沙川皖玻璃钢制品有限公司 | 临朐空调移机_空调维修「空调回收」临朐二手空调 | 陕西安闸机-伸缩门-车牌识别-广告道闸——捷申达门业科技 | 打孔器,打孔钳厂家【温州新星德牌五金工具】 | 车牌识别道闸_停车场收费系统_人脸识别考勤机_速通门闸机_充电桩厂家_中全清茂官网 | nalgene洗瓶,nalgene量筒,nalgene窄口瓶,nalgene放水口大瓶,浙江省nalgene代理-杭州雷琪实验器材有限公司 | CE认证_FCC认证_CCC认证_MFI认证_UN38.3认证-微测检测 CNAS实验室 | 头条搜索极速版下载安装免费新版,头条搜索极速版邀请码怎么填写? - 欧远全 | ge超声波测厚仪-电动涂膜机-电动划格仪-上海洪富 | 高低温试验房-深圳高低温湿热箱-小型高低温冲击试验箱-爱佩试验设备 | 医学动画公司-制作3d医学动画视频-医疗医学演示动画制作-医学三维动画制作公司 | 棉服定制/厂家/公司_棉袄订做/价格/费用-北京圣达信棉服 | 镀锌角钢_槽钢_扁钢_圆钢_方矩管厂家_镀锌花纹板-海邦钢铁(天津)有限公司 | 陶瓷砂磨机,盘式砂磨机,棒销式砂磨机-无锡市少宏粉体科技有限公司 |