1. <i id='wNClT'><tr id='wNClT'><dt id='wNClT'><q id='wNClT'><span id='wNClT'><b id='wNClT'><form id='wNClT'><ins id='wNClT'></ins><ul id='wNClT'></ul><sub id='wNClT'></sub></form><legend id='wNClT'></legend><bdo id='wNClT'><pre id='wNClT'><center id='wNClT'></center></pre></bdo></b><th id='wNClT'></th></span></q></dt></tr></i><div id='wNClT'><tfoot id='wNClT'></tfoot><dl id='wNClT'><fieldset id='wNClT'></fieldset></dl></div>
          <bdo id='wNClT'></bdo><ul id='wNClT'></ul>

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

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

        pyqt5不显示窗口

        时间:2023-08-04

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

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

                • <bdo id='wBp3H'></bdo><ul id='wBp3H'></ul>
                  <tfoot id='wBp3H'></tfoot>

                    <tbody id='wBp3H'></tbody>
                • <legend id='wBp3H'><style id='wBp3H'><dir id='wBp3H'><q id='wBp3H'></q></dir></style></legend>
                  本文介绍了pyqt5不显示窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我真的希望有人可以帮助我解决这个问题.我正在尝试开始使用 pyqt5,并且几乎从我正在学习的课程中复制了这段代码.代码似乎执行没有任何问题,但我应该看到的窗口根本没有出现,我做错了什么?顺便说一下,我正在研究 ubuntu 18

                  I really hope someone can help me out on this one. Im trying to get started with using pyqt5, and have pretty much copied this code from a course that i am taking. the code seems to execute without any problems, but the window that i should be seeing is simply not appearing, what am I doing wrong? Im working on ubuntu 18 by the way

                  from PyQt5.QtCore import *
                  from PyQt5.QtWidgets import *
                  
                  
                  class Page(QWidget):
                      def __init__(self, parent=None):
                      super(Page, self).__init__(parent)
                  
                      my_label = QLabel("This is my labet")
                      layout = QVBoxLayout()
                  
                      layout.addWidget(my_label)
                  
                      mainLayout = QGridLayout()
                      mainLayout.addLayout(layout, 0, 1)
                  
                      self.setLayout(mainLayout)
                      self.setWindowTitle("my first Qt app")
                  
                  if __name__ == "__mongo__":
                      import sys
                      print("LOEREE")
                      app = QApplication(sys.argv)
                  
                  window = Page()
                  window.show()
                  

                  推荐答案

                  在你的例子中有一些拼写错误,最后没有一行 sys.exit (app.exec _ ())它启动了应用程序的主循环.从这里开始处理事件.

                  In your example there were some typos and at the end there was no line sys.exit (app.exec _ ()) which starts the main loop of the application. From here begins the processing of events.

                  from PyQt5.QtCore    import * 
                  from PyQt5.QtWidgets import *
                  
                  class Page(QWidget): 
                      def __init__(self, parent=None):             # __init__
                          super(Page, self).__init__(parent)       # __init__
                  
                          my_label = QLabel("This is my labet")
                          layout   = QVBoxLayout()
                  
                          layout.addWidget(my_label)
                  
                          mainLayout = QGridLayout()
                          mainLayout.addLayout(layout, 0, 1)
                  
                          self.setLayout(mainLayout)
                          self.setWindowTitle("my first Qt app")
                  
                  if __name__ == '__main__':                       # 
                      import sys 
                      print("LOEREE") 
                      app = QApplication(sys.argv)
                      window = Page()
                      window.show()
                      sys.exit(app.exec_())                         # !!!
                  

                  这篇关于pyqt5不显示窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在 QCalendarWidget 中将项目添加到 QTableView 下一篇:PyQt5 QLCNumber 没有更新

                  相关文章

                  最新文章

                • <legend id='HhCGi'><style id='HhCGi'><dir id='HhCGi'><q id='HhCGi'></q></dir></style></legend>

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

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

                    1. <tfoot id='HhCGi'></tfoot>

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