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

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

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

        使用 QTdesigner 創(chuàng)建的 PyQt5 程序從終端打開時(shí)不顯

        PyQt5 program created with QTdesigner doesnt show any window when opened from terminal(使用 QTdesigner 創(chuàng)建的 PyQt5 程序從終端打開時(shí)不顯示任何窗口)
        • <bdo id='8TMYu'></bdo><ul id='8TMYu'></ul>
          <i id='8TMYu'><tr id='8TMYu'><dt id='8TMYu'><q id='8TMYu'><span id='8TMYu'><b id='8TMYu'><form id='8TMYu'><ins id='8TMYu'></ins><ul id='8TMYu'></ul><sub id='8TMYu'></sub></form><legend id='8TMYu'></legend><bdo id='8TMYu'><pre id='8TMYu'><center id='8TMYu'></center></pre></bdo></b><th id='8TMYu'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='8TMYu'><tfoot id='8TMYu'></tfoot><dl id='8TMYu'><fieldset id='8TMYu'></fieldset></dl></div>
            <legend id='8TMYu'><style id='8TMYu'><dir id='8TMYu'><q id='8TMYu'></q></dir></style></legend>

                <tbody id='8TMYu'></tbody>

            1. <tfoot id='8TMYu'></tfoot>
                • <small id='8TMYu'></small><noframes id='8TMYu'>

                  本文介紹了使用 QTdesigner 創(chuàng)建的 PyQt5 程序從終端打開時(shí)不顯示任何窗口的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在使用 QT Designer 沒有任何問題,但是今天我開始了全新的 ubuntu 18.04 安裝,但是這次當(dāng)我從終端運(yùn)行 PyQt5 程序時(shí),它們沒有顯示任何窗口,從 atom-runner 運(yùn)行時(shí)出現(xiàn)同樣的問題(它沒有甚至顯示任何錯(cuò)誤)

                  I was working with QT Designer with no issues but today i started a fresh ubuntu 18.04 install, but this time when i run the PyQt5 programs from terminal they doesnt show any windows, same issue when running from atom-runner (It doesnt even show any error)

                  我將 .ui 文件從 Qt Designer 保存后直接使用 pyuic5 導(dǎo)出為 .py,嘗試了一個(gè)簡(jiǎn)單的空白窗口和同樣的問題

                  I exported the .ui files into .py using pyuic5 directly after saving them from Qt Designer, tried a simple blank window and same problem

                  知道如何解決這個(gè)問題嗎?

                  Any idea how can i fix this?

                  這是一個(gè)代碼示例,一個(gè)應(yīng)該顯示但由于某種原因它不會(huì)顯示的簡(jiǎn)單窗口

                  This is an example of the code, a simple window that should show but for some reason it wont

                       # -*- coding: utf-8 -*-
                  
                  # Form implementation generated from reading ui file 'label.ui'
                  #
                  # Created by: PyQt5 UI code generator 5.11.3
                  #
                  # WARNING! All changes made in this file will be lost!
                  
                  from PyQt5 import QtCore, QtGui, QtWidgets
                  
                  class Ui_MainWindow(object):
                      def setupUi(self, MainWindow):
                          MainWindow.setObjectName("MainWindow")
                          MainWindow.resize(315, 142)
                          self.centralwidget = QtWidgets.QWidget(MainWindow)
                          self.centralwidget.setObjectName("centralwidget")
                          self.label = QtWidgets.QLabel(self.centralwidget)
                          self.label.setGeometry(QtCore.QRect(20, 20, 371, 111))
                          font = QtGui.QFont()
                          font.setPointSize(45)
                          self.label.setFont(font)
                          self.label.setObjectName("label")
                          MainWindow.setCentralWidget(self.centralwidget)
                          self.statusbar = QtWidgets.QStatusBar(MainWindow)
                          self.statusbar.setObjectName("statusbar")
                          MainWindow.setStatusBar(self.statusbar)
                  
                          self.retranslateUi(MainWindow)
                          QtCore.QMetaObject.connectSlotsByName(MainWindow)
                  
                      def retranslateUi(self, MainWindow):
                          _translate = QtCore.QCoreApplication.translate
                          MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
                          self.label.setText(_translate("MainWindow", "DA LABEL"))
                  

                  推薦答案

                  要生成可以使用 pyuic 顯示窗口的代碼,您必須使用 -x 選項(xiàng):

                  To generate a code that can show a window using pyuic you must use the -x option:

                  pyuic5 input.ui -o output.py -x
                  

                  使用 -x 的上一條命令將以下代碼添加到文件末尾:

                  The previous command using the -x adds the following code to the end of the file:

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

                  這篇關(guān)于使用 QTdesigner 創(chuàng)建的 PyQt5 程序從終端打開時(shí)不顯示任何窗口的文章就介紹到這了,希望我們推薦的答案對(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)度條?)
                    • <bdo id='cGgno'></bdo><ul id='cGgno'></ul>

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

                            <tbody id='cGgno'></tbody>

                        • <tfoot id='cGgno'></tfoot>
                        • <small id='cGgno'></small><noframes id='cGgno'>

                          <legend id='cGgno'><style id='cGgno'><dir id='cGgno'><q id='cGgno'></q></dir></style></legend>
                          1. 主站蜘蛛池模板: 一区二区小视频 | 免费观看成人鲁鲁鲁鲁鲁视频 | 婷婷午夜天 | 久久日本 | 国产日韩欧美精品一区二区 | 日韩精品一区二区三区中文字幕 | 国产精品一区二区三区免费观看 | 国产精品日产欧美久久久久 | 中国一级特黄毛片大片 | 一级黄色片免费 | 亚洲国产一区二区三区 | 手机看片在线播放 | 久久久久国产精品 | 水蜜桃久久夜色精品一区 | 国产精品中文字幕在线 | 亚洲成人激情在线观看 | 久久精品亚洲成在人线av网址 | 国产亚洲成av人片在线观看桃 | 精品美女在线观看视频在线观看 | 麻豆视频在线免费看 | 日本一道本视频 | 免费看黄色片 | 国产激情一区二区三区 | 91av视频| 影视先锋av资源噜噜 | 欧美综合一区二区 | 亚洲第一成人av | 久久久久九九九女人毛片 | 亚洲久草| 成人午夜精品 | 操操操av | 精品av天堂毛片久久久借种 | 成人精品国产 | 久久久久国产精品一区二区 | 国产99精品 | 国产一级在线 | 黑人巨大精品欧美一区二区免费 | 毛片黄片免费看 | 免费麻豆视频 | 国产高清免费 | 国产在线1 |