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

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

    1. <small id='kLqJn'></small><noframes id='kLqJn'>

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

    2. 如何將函數綁定到 Qt 菜單欄中的操作?

      How to bind a function to an Action from Qt menubar?(如何將函數綁定到 Qt 菜單欄中的操作?)
          <tbody id='Ixxwg'></tbody>
        • <legend id='Ixxwg'><style id='Ixxwg'><dir id='Ixxwg'><q id='Ixxwg'></q></dir></style></legend>

              <tfoot id='Ixxwg'></tfoot>

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

                <bdo id='Ixxwg'></bdo><ul id='Ixxwg'></ul>

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

              • 本文介紹了如何將函數綁定到 Qt 菜單欄中的操作?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我正在使用 Python3 和 PyQt5,在 Qt Designer 中制作我的小部件和窗口.更重要的是,我不會從 .ui 生成 .py 文件.我只是使用下一個代碼加載它:

                I'm using Python3 and PyQt5, make my widgets and windows in Qt Designer. What is more, I do not generate .py files from a .ui. I simply load it using next code:

                class MainWindow(QMainWindow):
                
                def __init__(self):
                    super(MainWindow, self).__init__()
                    uic.loadUi('UI/Qt/source/MainWindow.ui', self)
                

                所以,我想知道,如何將菜單欄操作綁定到函數.

                So, I wanted to know, how do I bind menu bar actions to functions.

                有什么辦法可以做這樣的事情嗎?

                Is there any way I can do something like this?

                self.getActionByName("actionTest_Action").connect(self.do_something)
                

                推薦答案

                在使用loadUi的時候不需要使用findChild,因為該方法以objectName為名稱將對象添加到類的屬性中,例如在這個比另一個答案更簡潔的代碼是:

                It is not necessary to use findChild when using loadUi since this method adds the object to the attributes of the class using the objectName as a name, for example in this particular case a cleaner code than the other answer is:

                class MainWindow(QMainWindow):
                    def __init__(self):
                        super(MainWindow, self).__init__()
                        uic.loadUi('UI/Qt/source/MainWindow.ui', self)
                
                        self.actionTest_Action.triggered.connect(self.test)
                
                    def test(self):
                        print("Test")

                這篇關于如何將函數綁定到 Qt 菜單欄中的操作?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                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時顯示進度條?)
                Erasing pen on a canvas(在畫布上擦筆)

                      <tbody id='uXM26'></tbody>
                  • <legend id='uXM26'><style id='uXM26'><dir id='uXM26'><q id='uXM26'></q></dir></style></legend>

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

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

                    • <tfoot id='uXM26'></tfoot>
                      • <bdo id='uXM26'></bdo><ul id='uXM26'></ul>
                        1. 主站蜘蛛池模板: 久久人人网 | 久久精品一区 | 成人小视频在线观看 | 国产精品一区二区视频 | 国产情侣啪啪 | 91 久久| 91看片在线观看 | 91精品国产91久久久 | 日韩色视频 | 精品久久久999| 久久精品一区二区三区四区 | 日韩精品成人av | 看a网站 | 精品在线一区二区三区 | 亚洲精品久久国产高清情趣图文 | 欧美日韩国产一区 | 成人免费淫片aa视频免费 | 精品免费国产一区二区三区四区 | 久久久久久久av | 99re在线视频观看 | 在线不卡视频 | 毛片1 | 黄色免费网站在线看 | 亚洲aⅴ | 日韩一区二区三区视频在线播放 | 欧美在线视频网 | 在线免费看黄 | av一级久久| 久在草| 国产精品久久久久aaaa | 亚洲第一区国产精品 | 精品福利在线 | 999精品在线观看 | 日本在线视频中文字幕 | 操一草| 欧美一区二区三区视频在线 | 精品欧美一区二区久久久伦 | 日韩a在线 | 亚洲高清在线播放 | 亚洲国产精品激情在线观看 | 日韩精品极品视频在线观看免费 |