What is a difference between these two clicked() signals in PyQt?

时间秒杀一切 提交于 2019-12-02 10:40:47

The first option is the old-style signal and slot syntax, which is now obsolete. You can still use it in PyQt4, but it is not supported at all in PyQt5. The second option is the new-style signal and slot syntax, which can be used in PyQt5 and all recent versions of PyQt4 (it was introduced in v4.5).

The PyQt docs lists the following disadvantages of the old-style syntax:

  • It requires knowledge of the C++ types of signal arguments.
  • It is error prone in that if you mis-type the signal name or signature - then no exception is raised, either when the signal is connected or emitted.
  • It is verbose.
  • It is not Pythonic.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!