0
在下面的代碼中,第一個函數被調用,但第二個函數沒有調用。我究竟做錯了什麼?QTimer未按預期調用myfunction
def time_cursor_plot(self):
print 'function called'
t = QtCore.QTimer()
t.setInterval(1000)
t.timeout.connect(self.start_timer)
t.start()
def start_timer(self):
print ' this one too'
你讓計時器被垃圾收集。 – ekhumoro
你的代碼示例沒有意義......你有沒有改變方法名稱?什麼是start_timer()方法? –