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

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

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

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

        pyQt5 更改 MainWindow 標(biāo)志

        pyQt5 change MainWindow Flags(pyQt5 更改 MainWindow 標(biāo)志)

          • <tfoot id='6gRUQ'></tfoot>

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

                • <bdo id='6gRUQ'></bdo><ul id='6gRUQ'></ul>

                  <small id='6gRUQ'></small><noframes id='6gRUQ'>

                    <tbody id='6gRUQ'></tbody>
                  本文介紹了pyQt5 更改 MainWindow 標(biāo)志的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我使用 python 3.4、pyQt5 和 Qt 設(shè)計器(Winpython 發(fā)行版).我喜歡由設(shè)計師制作 gui 并使用 setupUi 將它們導(dǎo)入 python 的想法.我能夠顯示 MainWindows 和 QDialogs.但是,現(xiàn)在我想設(shè)置我的 MainWindow,總是在頂部并且只有關(guān)閉按鈕.我知道這可以通過設(shè)置 Windows 標(biāo)志來完成.我嘗試執(zhí)行以下操作:

                  I use python 3.4 , pyQt5 and Qt designer (Winpython distribution). I like the idea of making guis by designer and importing them in python with setupUi. I'm able to show MainWindows and QDialogs. However, now I would like to set my MainWindow, always on top and with the close button only. I know this can be done by setting Windows flags. I tried to do as following:

                  from PyQt5 import QtCore, QtGui, QtWidgets
                  import sys
                  class MainWindow(QtWidgets.QMainWindow,Ui_MainWindow):
                      def __init__(self, parent=None):
                          super(MainWindow, self).__init__(parent)
                          self.setupUi(self)
                          self.setWindowFlags(QtCore.Qt.WindowCloseButtonHint | QtCore.Qt.WindowMinimizeButtonHint)
                          self.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
                  if __name__ == '__main__':
                      app = QtWidgets.QApplication(sys.argv)
                      form = MainWindow()
                      form.show()
                      sys.exit(app.exec_())
                  

                  顯示主窗口(沒有錯誤),但未應(yīng)用標(biāo)志.我想這是因為我在創(chuàng)建 Windows 屬性后要求更改它.現(xiàn)在,問題是:我如何在不直接修改 Ui_MainWindow 的情況下做到這一點?可以在 Qt 設(shè)計器中更改標(biāo)志嗎?謝謝

                  The MainWindow shows up (without error) but Flags are not applied. I suppose this is because I asked to change Windows properties after it was already created. Now, questions are : how I can do it without modify Ui_MainWindow directly? It is possible to change flags in Qt designer ? Thanks

                  推薦答案

                  每次調(diào)用 setWindowFlags 都會完全覆蓋當(dāng)前設(shè)置,因此您需要一次設(shè)置所有標(biāo)志.此外,您必須包含 CustomizeWindowHint 標(biāo)志,否則所有其他提示將被忽略.以下可能適用于 Windows:

                  Every call of setWindowFlags will completely override the current settings, so you need to set all the flags at once. Also, you must include the CustomizeWindowHint flag, otherwise all the other hints will be ignored. The following will probably work on Windows:

                      self.setWindowFlags(
                          QtCore.Qt.Window |
                          QtCore.Qt.CustomizeWindowHint |
                          QtCore.Qt.WindowTitleHint |
                          QtCore.Qt.WindowCloseButtonHint |
                          QtCore.Qt.WindowStaysOnTopHint
                          )
                  

                  但是,這不太可能適用于所有平臺.提示"確實就是這個意思.窗口管理器完全可以忽略這些標(biāo)志,并且不能保證它們都會以相同的方式運行.

                  However, it is highly unlikely this will work on all platforms. "Hint" really does mean just that. Window managers are completely free to ignore these flags and there's no guarantee they will all behave in the same way.

                  PS:

                  不能在 Qt Designer 中設(shè)置窗口標(biāo)志.

                  It is not possible to set the window flags in Qt Designer.

                  這篇關(guān)于pyQt5 更改 MainWindow 標(biāo)志的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(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 啟動后進度躍升至 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)我向左或向右滾動時,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時顯示進度條?)
                    <bdo id='S45KC'></bdo><ul id='S45KC'></ul>
                    <i id='S45KC'><tr id='S45KC'><dt id='S45KC'><q id='S45KC'><span id='S45KC'><b id='S45KC'><form id='S45KC'><ins id='S45KC'></ins><ul id='S45KC'></ul><sub id='S45KC'></sub></form><legend id='S45KC'></legend><bdo id='S45KC'><pre id='S45KC'><center id='S45KC'></center></pre></bdo></b><th id='S45KC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='S45KC'><tfoot id='S45KC'></tfoot><dl id='S45KC'><fieldset id='S45KC'></fieldset></dl></div>
                        <tbody id='S45KC'></tbody>

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

                            <legend id='S45KC'><style id='S45KC'><dir id='S45KC'><q id='S45KC'></q></dir></style></legend>
                            <tfoot id='S45KC'></tfoot>
                          1. 主站蜘蛛池模板: 在线观看深夜视频 | 国产一区二区自拍 | 精品无码久久久久久国产 | a免费视频| 久久久久亚洲精品中文字幕 | 一区视频| 亚洲美女视频 | 久久精品一级 | 日韩无| 欧美 中文字幕 | 中文字幕国产精品 | 国产精品美女一区二区 | 成人午夜免费视频 | 成人在线国产 | 天天操天天干天天透 | 九九色综合 | 国产精品视频一二三区 | 91麻豆精品一区二区三区 | 中文字幕一区二区不卡 | 综合伊人 | 欧美9999 | 亚洲一区二区 | 欧美日韩91 | 99久久精品国产一区二区三区 | 欧美一区二区三区电影 | h在线 | 欧美激情精品久久久久久 | 欧洲妇女成人淫片aaa视频 | 狠狠干美女 | 中文字幕韩在线第一页 | 影视一区 | 精品一区二区久久久久久久网站 | 欧美黄色大片在线观看 | 国产高清精品在线 | 欧美精品一区二区三区视频 | 国产精品一区二区三区免费观看 | 欧美精品久久久久久 | 亚洲入口| 日韩黄色小视频 | 午夜影院 | 国产日韩欧美一区二区 |