Signals and Missing Positional Arguments

后端 未结 2 1122
一向
一向 2020-12-12 03:48

I developed two windows in QtDesigner (SourceForm, DestinationForm) and used pyuic5 to convert their .ui pages. I am using a third class WController as a way to

2条回答
  •  被撕碎了的回忆
    2020-12-12 04:28

    You need to be careful when using pyqtSlot, as it is only too easy to clobber the signature of the slot it is decorating. In your case, it has re-defined the slot as having no arguments, which explains why you are getting that error message. The simple fix is to simply remove it, as your example will work perfectly well without it.

    The main purpose of pyqtSlot is to allow several different overloads of a slot to be defined, each with a different signature. It may also be needed sometimes when making cross-thread connections. However, these use-cases are relatively rare, and in most PyQt/PySide applications it is not necessary to use pyqtSlot at all. Signals can be connected to any python callable object, whether it is decorated as a slot or not.

提交回复
热议问题