MainWindow object has no attribute 'connect'

后端 未结 1 1283
自闭症患者
自闭症患者 2020-12-12 03:20

I wonder if someone could help me resolve this issue regarding slot connection in PyQt5. The following code snippet will show you what my problem is.

class M         


        
相关标签:
1条回答
  • 2020-12-12 03:33

    You are using the old style signal and slot, which is not longer supported in PyQt5.

    The old style:

    self.connect(origin, SIGNAL('completed'), self._show_results)
    

    should now be written in the new style:

    origin.completed.connect(self._show_results)
    

    For more details, see the documentation on New-style Signal and Slot Support.

    0 讨论(0)
提交回复
热议问题