0
作爲PyQt5 Gui的python腳本中的函數的一部分,我有以下代碼:Pyqt QtCore.QTimer().timeout.connect(self.function)error [缺少1個必需的位置參數:'窗體']
def link_info(self, Form):
self.timer = QtCore.QTimer()
self.timer.stop
self.ip=self.lineEdit_ip.text()
self.port=int(self.lineEdit_2.text())
self.function(Form)
print('here')
self.timer.timeout.connect(self.function)
self.timer.start(5000)
我收到錯誤:
function() missing 1 required positional argument: 'Form'
當我的代碼更改爲:
self.timer.timeout.connect(self.function(Form))
我得到的錯誤:
argument 1 has unexpected type 'NoneType'
我該如何解決這個問題?
感謝