Solved.

The function closeEvent() is inappropriate for this case.
I just created a kinship between the windows to make this possible. The closeEvent () now comes as a complement.

Qt Code:
  1. #!/usr/bin/env python
  2. #-*- coding: utf-8 -*-
  3.  
  4. import sys
  5. from PyQt4.QtGui import *
  6. from PyQt4.QtCore import *
  7.  
  8.  
  9. class popup(QMainWindow):
  10. def __init__(self,parent=None): # Parentesco
  11. super(popup,self).__init__(parent)
  12.  
  13.  
  14. self.setWindowTitle("Janela Popup")
  15.  
  16.  
  17. self.setMinimumSize(400 , 400)
  18.  
  19.  
  20.  
  21. class Mainw(QMainWindow):
  22. def __init__(self, parent=None):
  23. super(Mainw, self).__init__(parent)
  24.  
  25.  
  26. self.setMinimumSize(400 , 400)
  27.  
  28.  
  29. self.setWindowTitle("Janela Principal")
  30.  
  31. self.btn1 = QPushButton("Popup", self)
  32.  
  33. self.btn1.setGeometry(QRect(100, 50, 200, 200))
  34.  
  35. QObject.connect(self.btn1, SIGNAL("clicked()"), self.openpopup)
  36.  
  37. def openpopup(self):
  38. pop = popup(self)
  39. pop.show()
  40.  
  41.  
  42.  
  43. if __name__ == "__main__":
  44. app = QApplication(sys.argv)
  45. main = Mainw()
  46. main.show()
  47. sys.exit(app.exec_())
To copy to clipboard, switch view to plain text mode