久久久久久久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. 主站蜘蛛池模板: 国产日日操 | 欧美日韩国产一区二区三区 | 国产中文字幕在线 | 国产精品国产精品国产专区不蜜 | а_天堂中文最新版地址 | 欧美精品一区二区三区在线四季 | 国产精品揄拍一区二区久久国内亚洲精 | 欧美在线a| 中文字幕蜜臀av | 亚洲欧美成人 | www.com久久久| 精品久久久久久久久久久 | 中文字幕日韩欧美一区二区三区 | 国产一区久久 | 亚洲免费大片 | 久久久久久久久久久久一区二区 | 亚洲经典一区 | 自拍偷拍第一页 | 久久精品国产久精国产 | 99综合在线 | 日韩成人久久 | 91丨九色丨国产在线 | 九九在线视频 | 午夜精品一区二区三区在线观看 | 国产一区二区在线免费播放 | 欧美在线成人影院 | 看黄在线 | 亚洲国产专区 | 男女网站在线观看 | 91在线视频免费观看 | 精品亚洲一区二区三区四区五区 | 一区二区三区精品视频 | 中文字幕亚洲一区二区va在线 | 日韩欧美一级精品久久 | 亚洲中午字幕 | 精品国产一区二区三区久久久久久 | 欧美成人手机在线 | 欧美日韩综合精品 | 色婷婷av久久久久久久 | 成人免费大片黄在线播放 | 波多野结衣一区二区 |