0

I was trying the following PyQt5 code from the answers in Singleshot: SLOT with arguments:

from PyQt5 import QtCore
QtCore.QTimer.singleShot(1, self, QtCore.SLOT(recall(arg1)), arg1)

But I get an error about the QtCore.SLOT part that says:

Undefined variable from import: SLOT

I'm new to PyQt5, and I am wondering:

Is this error due to version differences between PyQt 4 and 5?

What's the right way of writing it in PyQt5?

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
thor
  • 21,418
  • 31
  • 87
  • 173
  • That method no longer exists in PyQt5, it uses a lambda function as the other answer shows: https://stackoverflow.com/a/7497574/6622587 – eyllanesc Jan 10 '18 at 05:14
  • @eyllanesc Thanks! if you make your comment an answer, I'll accept it. – thor Jan 10 '18 at 05:29

0 Answers0