私はスロットに一つだけのオーバーロード(int)を接続したい2つの過負荷過負荷信号に具体的に接続する方法は?
buttonClicked = pyqtSignal([int],[str])
で信号を使用しています。私がemitを他のオーバーロード(str)と呼び出すときは、何も起こりません。これを達成する方法は?
class Example(QWidget):
buttonClicked = pyqtSignal([int],[str])
def __init__(self):
super().__init__()
self.init_ui()
def init_ui(self):
self.btn = QPushButton('Button',self)
self.btn.clicked.connect(self.doAction)
self.make_conn()
self.setWindowTitle('Yo')
self.show()
def make_conn(self):
self.buttonClicked.connect(self.showDialog) #How to make specific connection here . Using self.buttonClicked[int].connect(self.showDialog) doesnt work.
def showDialog(self):
print('here')
def doAction(self):
self.buttonClicked.emit('soru') #should NOT call showDialog
self.buttonClicked.emit(23) #should call showDialog