Hello,

This below given code is giving a race condition, i.e. sometimes gives the result as expected, sometimes gives error, sometimes just does nothing. It is part of a subclassed qt form which i am using as main dialog. This behaviour occurs when i close the dialog whereby ending the application. what i want to achieve is that when the dialog is closed if any unsaved data, prompt the user.

Thanks

George


___________________________________________________________________________________________________________________________________

def __del__(self):
   if self.Saved==False:
      choice = PyQt4.QtGui.QMessageBox.question(self,'Warning','Data modified. 
Do you want to save?',
                                                QMessageBox.Yes | 
QMessageBox.No, QMessageBox.Yes)
      print(type(choice), choice)
      if choice == QMessageBox.Yes:
         self.SaveData()

___________________________________________________________________________________________________________________________________
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to