日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
創(chuàng)新互聯(lián)Python教程:python PyQt信號和插槽的連接

1、為了讓菜單選項和工具欄在用戶點擊它們時啟動,需要將信號與內(nèi)置插槽連接起來。

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

菜單和工具欄中最常用的信號是.triggered()。用戶每次點擊菜單選項或工具欄按鈕都會發(fā)出這個信號。

實例

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信號和插槽的連接方法,希望對大家有所幫助。更多Python學(xué)習(xí)指路:創(chuàng)新互聯(lián)python教程

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


本文名稱:創(chuàng)新互聯(lián)Python教程:python PyQt信號和插槽的連接
標題URL:http://m.5511xx.com/article/dhipooo.html