[PySide] Form dialog subclassing QDialog

Jérôme jerome at jolimont.fr
Fri Feb 28 21:48:30 CET 2014


Fri, 28 Feb 2014 19:59:49 +0100
Aaron Richiger a écrit:

>      def on_add_person(self):
>          '''A label was clicked, show the text of the label in the 
> display'''
>          dialog = NewPersonDialog()
>          if dialog.exec_():
>              self.model.add_person(Person(dialog.name, dialog.age))

Thank you both for your answers.

I wrongly assumed the dialog was destroyed at the end of the execution of its
exec_() method, and therefore it was too late to get its values. 

This is why I was willing to provide those values as return value of exec_().

Thank you also Aaron for the extensive example. It is a true MVC design
lesson.

-- 
Jérôme



More information about the PySide mailing list