久久久久久久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. 如何將函數(shù)綁定到 Qt 菜單欄中的操作?

      How to bind a function to an Action from Qt menubar?(如何將函數(shù)綁定到 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>

              • 本文介紹了如何將函數(shù)綁定到 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)
                

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

                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")

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

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

                相關文檔推薦

                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` 構造函數(shù)有未知關鍵字 `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. 主站蜘蛛池模板: 国产精品国产精品国产专区不卡 | 国产黄色免费网站 | 日韩毛片免费 | 精品一区二区在线播放 | 欧美成人一区二区 | www.粉色视频在线观看 | 丝袜美腿一区二区三区 | 久久手机免费视频 | 九九视频这里只有精品 | 国产精品久久久久久久久久久久久久久 | 一级黄色网 | 久草热视频| 中文字幕在线观看一区二区 | 视频在线观看网站免费 | 亚洲欧美中文字幕 | 免费看黄网 | 亚洲一区二区久久 | 一区二区三区在线免费 | 操碰在线视频 | www.日韩| 中文字幕一区二区三区乱码 | 色一情一乱一乱一区91av | 亚洲成人免费网站 | av一区二区三区四区 | 谁有毛片网址 | 欧美国产日韩一区二区 | 福利视频二区 | 欧美精品入口蜜桃 | 亚洲精品久久久久久久久 | 视频一区二区在线 | 亚洲国产精品一区二区三区 | 国产精品久免费的黄网站 | 日韩中文字幕视频 | 欧美性生活网站 | 欧美成人一区二区 | 能看毛片的网站 | 亚洲综合成人网 | 国产又粗又猛又黄又爽无遮挡 | 在线中文av | 怡红院亚洲 | 欧美日韩精品一区二区在线播放 |