av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

創(chuàng)新互聯(lián)Python教程:python PyQt信號(hào)和插槽的連接

1、為了讓菜單選項(xiàng)和工具欄在用戶(hù)點(diǎn)擊它們時(shí)啟動(dòng),需要將信號(hào)與內(nèi)置插槽連接起來(lái)。

2、QAction物體可以發(fā)出各種信號(hào)。triggered()與插槽連接。

菜單和工具欄中最常用的信號(hào)是.triggered()。用戶(hù)每次點(diǎn)擊菜單選項(xiàng)或工具欄按鈕都會(huì)發(fā)出這個(gè)信號(hào)。

實(shí)例

class Window(QMainWindow):
    # Snip...
    def newFile(self):
        # Logic for creating a new file goes here...
        self.centralWidget.setText("File > New clicked")
 
    def openFile(self):
        # Logic for opening an existing file goes here...
        self.centralWidget.setText("File > Open... clicked")
 
    def saveFile(self):
        # Logic for saving a file goes here...
        self.centralWidget.setText("File > Save clicked")
 
    def copyContent(self):
        # Logic for copying content goes here...
        self.centralWidget.setText("Edit > Copy clicked")
 
    def pasteContent(self):
        # Logic for pasting content goes here...
        self.centralWidget.setText("Edit > Paste clicked")
 
    def cutContent(self):
        # Logic for cutting content goes here...
        self.centralWidget.setText("Edit > Cut clicked")
 
    def helpContent(self):
        # Logic for launching help goes here...
        self.centralWidget.setText("Help > Help Content... clicked")
 
    def about(self):
        # Logic for showing an about dialog content goes here...
        self.centralWidget.setText("Help > About... clicked")

以上就是python PyQt信號(hào)和插槽的連接方法,希望對(duì)大家有所幫助。更多Python學(xué)習(xí)指路:創(chuàng)新互聯(lián)python教程

本文教程操作環(huán)境:windows7系統(tǒng)、Python 3.9.1,DELL G3電腦。


網(wǎng)頁(yè)題目:創(chuàng)新互聯(lián)Python教程:python PyQt信號(hào)和插槽的連接
URL地址:http://uogjgqi.cn/article/dhipooo.html
掃二維碼與項(xiàng)目經(jīng)理溝通

我們?cè)谖⑿派?4小時(shí)期待你的聲音

解答本文疑問(wèn)/技術(shù)咨詢(xún)/運(yùn)營(yíng)咨詢(xún)/技術(shù)建議/互聯(lián)網(wǎng)交流