[PySide] QSelectionModel.currentChanged/selectedChanged signals give troubles

Andy Kittner andy.kittner at gmail.com
Thu Jan 16 12:53:45 CET 2014


On 16.01.2014 11:50, Alexey Vihorev wrote:
> Hi!
> 
> I’ve got a problem trying to connect currentChanged/selectedChanged signals to anything. The code:
I vaguely remember having a similar problem once (it's ages ago so
things might have changed).
After some debugging I found that the object providing the slot was garbage
collected before the connection was made resulting in the crash.


Can you try changing this

>         self.view.selectionModel().currentChanged.connect(self.handler)

To the following:

          selection_model = self.view.selectionModel()
          selection_model.currentChanged.connect(self.handler)

And see if that helps?

Regards,
Andy



More information about the PySide mailing list