noel
noel

Reputation: 2339

PySide2 new Signal and Slot connection

There was a recent update in PySide2 and now all of my apps are broken. I have code like this...

from PySide2.QtCore import *                                                   

class Saver(QObject):                                                                               

    doneSaving = Signal()                                                      

    def __init__(self, app, signaller, param, items):                             
        """Constructor"""                                                         
        super(Saver, self).__init__()                                             

        self.app = app                                                            
        self.param = param                                                        
        self.items = items                                                        

        sig = app.getSignaller(signaller)                                         
        help(sig.valueAvailable)                                                  
        sig.valueAvailable.connect(self.dataReceived)                                         

        self.saving = False

And it recently stopped working because apparently QtCore.Signal() no longer has an attribute called connect. I've looked through the docs but can't find anything.

Does any one know the new syntax to connect signals and slots in PySide2?

Upvotes: 1

Views: 2715

Answers (1)

noel
noel

Reputation: 2339

I finally resolved this. I had jumped the gun in thinking that it was the API that had changed. My app is using Shiboken to wrap some C++ stuff and it was those shared objects which had changed.

After recompiling all the wrappers everything started working again.

Upvotes: 1

Related Questions