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

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

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

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

      1. <legend id='UaTjS'><style id='UaTjS'><dir id='UaTjS'><q id='UaTjS'></q></dir></style></legend>
      2. <tfoot id='UaTjS'></tfoot>

        PyQt:如何從 Qt Designer 加載多個 .ui 文件

        PyQt: how to load multiple .ui Files from Qt Designer(PyQt:如何從 Qt Designer 加載多個 .ui 文件)
          <tbody id='vTCU2'></tbody>
      3. <tfoot id='vTCU2'></tfoot>
        <i id='vTCU2'><tr id='vTCU2'><dt id='vTCU2'><q id='vTCU2'><span id='vTCU2'><b id='vTCU2'><form id='vTCU2'><ins id='vTCU2'></ins><ul id='vTCU2'></ul><sub id='vTCU2'></sub></form><legend id='vTCU2'></legend><bdo id='vTCU2'><pre id='vTCU2'><center id='vTCU2'></center></pre></bdo></b><th id='vTCU2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='vTCU2'><tfoot id='vTCU2'></tfoot><dl id='vTCU2'><fieldset id='vTCU2'></fieldset></dl></div>

          1. <legend id='vTCU2'><style id='vTCU2'><dir id='vTCU2'><q id='vTCU2'></q></dir></style></legend>

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

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

                • 本文介紹了PyQt:如何從 Qt Designer 加載多個 .ui 文件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想添加啟動窗口,當我單擊按鈕時,它將打開另一個窗口并關閉當前窗口.對于每個窗口,它都有從 Qt Designer 以 .ui 形式創建的獨立 UI.

                  I want to add startup window that when I click button, it will open another window and close current window. For each window, it has seperated UI which created from Qt Designer in .ui form.

                  我通過 uic.loadUiType() 加載兩個 .ui 文件.第一個窗口(第一個 UI)通常可以顯示其 UI,但是當我單擊按鈕轉到另一個窗口時,另一個 UI(第二個 UI)不起作用.它喜歡打開空白窗口.

                  I load both .ui file via uic.loadUiType(). The first window(first UI) can normally show its UI but when I click button to go to another window, another UI (second UI) doesn't work. It likes open blank window.

                  另一個問題是,如果我加載第一個 UI,然后更改為第二個 UI(刪除該類并更改為另一個類,同時刪除 uic.loadUiType()),第二個 UI 仍然不起作用(顯示空白窗口)

                  Another problem is if I load first UI and then change to second UI (delete that Class and change to another Class, also delete uic.loadUiType()), the second UI still doesn't work (show blank window)

                  請幫助...我在創建此問題之前進行了研究,但找不到答案.

                  Please help... I research before create this question but can't find the answer.

                  這是我的代碼.我該如何解決?

                  Here's my code. How can I fix it?

                  import sys
                  from PyQt5.QtWidgets import QApplication, QWidget
                  from PyQt5.QtGui import QIcon
                  from PyQt5 import uic
                  
                  #load both ui file
                  uifile_1 = 'UI/openPage.ui'
                  form_1, base_1 = uic.loadUiType(uifile_1)
                  
                  uifile_2 = 'UI/mainPage.ui'
                  form_2, base_2 = uic.loadUiType(uifile_2)
                  
                  class Example(base_1, form_1):
                      def __init__(self):
                          super(base_1,self).__init__()
                          self.setupUi(self)
                          self.startButton.clicked.connect(self.change)
                  
                      def change(self):
                          self.main = MainPage()
                          self.main.show()
                  
                  class MainPage(base_2, form_2):
                      def __int__(self):
                          super(base_2, self).__init__()
                          self.setupUi(self)
                  
                  if __name__ == '__main__':
                      app = QApplication(sys.argv)
                      ex = Example()
                      ex.show()
                      sys.exit(app.exec_())
                  

                  推薦答案

                  首先出現錯誤,必須將__int__改為__init__.要關閉窗口,請調用 close() 方法.

                  First you have an error, you must change __int__ to __init__. To close the window call the close() method.

                  import sys
                  from PyQt5.QtWidgets import QApplication, QWidget
                  from PyQt5.QtGui import QIcon
                  from PyQt5 import uic
                  
                  #load both ui file
                  uifile_1 = 'UI/openPage.ui'
                  form_1, base_1 = uic.loadUiType(uifile_1)
                  
                  uifile_2 = 'UI/mainPage.ui'
                  form_2, base_2 = uic.loadUiType(uifile_2)
                  
                  class Example(base_1, form_1):
                      def __init__(self):
                          super(base_1,self).__init__()
                          self.setupUi(self)
                          self.startButton.clicked.connect(self.change)
                  
                      def change(self):
                          self.main = MainPage()
                          self.main.show()
                          self.close()
                  
                  class MainPage(base_2, form_2):
                      def __init__(self):
                          super(base_2, self).__init__()
                          self.setupUi(self)
                  
                  if __name__ == '__main__':
                      app = QApplication(sys.argv)
                      ex = Example()
                      ex.show()
                      sys.exit(app.exec_())
                  

                  這篇關于PyQt:如何從 Qt Designer 加載多個 .ui 文件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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='NjGUQ'><style id='NjGUQ'><dir id='NjGUQ'><q id='NjGUQ'></q></dir></style></legend>
                  • <small id='NjGUQ'></small><noframes id='NjGUQ'>

                        <bdo id='NjGUQ'></bdo><ul id='NjGUQ'></ul>
                          1. <tfoot id='NjGUQ'></tfoot>
                              <tbody id='NjGUQ'></tbody>
                            <i id='NjGUQ'><tr id='NjGUQ'><dt id='NjGUQ'><q id='NjGUQ'><span id='NjGUQ'><b id='NjGUQ'><form id='NjGUQ'><ins id='NjGUQ'></ins><ul id='NjGUQ'></ul><sub id='NjGUQ'></sub></form><legend id='NjGUQ'></legend><bdo id='NjGUQ'><pre id='NjGUQ'><center id='NjGUQ'></center></pre></bdo></b><th id='NjGUQ'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='NjGUQ'><tfoot id='NjGUQ'></tfoot><dl id='NjGUQ'><fieldset id='NjGUQ'></fieldset></dl></div>
                            主站蜘蛛池模板: 欧美一a一片一级一片 | 国产成人在线播放 | 成人a视频片观看免费 | 亚洲视频在线观看 | 欧美激情精品久久久久久 | 国产精品国产a | 亚洲精品久久久一区二区三区 | 精品亚洲一区二区三区 | 一级毛片视频 | 成人深夜福利在线观看 | 天天综合永久 | 国产区精品| 在线成人av | 欧美精品一区二区三区在线 | 亚洲视频一区二区三区 | 一区二区三区在线 | 欧 | 国产综合一区二区 | 网站黄色在线 | 99精品热视频 | 看真人视频一级毛片 | 国产欧美日韩一区二区三区 | 国产一级片久久久 | 亚洲综合日韩精品欧美综合区 | 美日韩免费视频 | 国产在线精品一区二区 | 免费国产视频在线观看 | 国产成人免费网站 | 午夜视频一区二区 | 国产精品久久网 | 最新中文字幕第一页视频 | 久久精品中文 | 三级视频在线观看 | 羞羞网站在线免费观看 | www.玖玖玖 | 99久久免费精品国产男女高不卡 | 午夜不卡福利视频 | 成人精品一区二区 | 日韩av在线一区 | 久久精品免费看 | 亚洲欧美一区二区三区视频 | a级网站 |