久久久久久久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 標志

        pyQt5 change MainWindow Flags(pyQt5 更改 MainWindow 標志)

          • <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 標志的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

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

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

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

                  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

                  推薦答案

                  每次調用 setWindowFlags 都會完全覆蓋當前設置,因此您需要一次設置所有標志.此外,您必須包含 CustomizeWindowHint 標志,否則所有其他提示將被忽略.以下可能適用于 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
                          )
                  

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

                  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 中設置窗口標志.

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

                  這篇關于pyQt5 更改 MainWindow 標志的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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時顯示進度條?)
                    <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. 主站蜘蛛池模板: 日韩一级在线观看 | 黄色免费小视频 | 在线观看av免费 | 美女黄色一级片 | 一本色道久久综合亚洲精品酒店 | 成人在线一区二区 | 日本久久视频 | 黄色在线免费看 | 三级视频在线 | 欧美一区 | 免费观看黄色大片 | 亚洲黄色片| 亚洲av毛片 | 亚洲欧美在线观看 | 久久久在线视频 | 福利网站在线观看 | 日韩毛片视频 | 狠狠干天天操 | 欧美黄色一区 | 免费h片| 国产视频一区二区在线 | 天天狠狠 | 黄色片视频在线观看 | 黄色片久久| 欧美大片黄 | 日韩在线视频免费观看 | www.亚洲视频 | 97精品超碰一区二区三区 | 中文在线一区二区 | 亚洲精品在线观看视频 | 欧美一区二区三区在线观看 | 在线不卡一区 | 国产成人精品一区二 | 日韩久久av| 欧美乱强伦 | 午夜视频在线免费观看 | 91视频日本 | 久操精品视频 | 欧美一级片在线观看 | 久久毛片视频 | 三级在线看 |