currentIndexChanged.connect() 用於監聽當前選擇的索引改變。
即,選擇的內容改變就會觸發!
items = ["腳本錄製", "腳本回放", "腳本管理"]
self.comboBox = QtWidgets.QComboBox()
self.comboBox.addItems(items)
self.comboBox.currentIndexChanged.connect(self.hello) # 當選擇內容改變時觸發事件
要觸發的事件
def hello(self):
print("內容改變了")
喜歡的點個贊❤吧!