<div dir="ltr">Hi all,<br><br>I am trying to ignore the close event of a subwindow, but I don't know how to do that.<br><br>Expecting for your suggestions.<br><br>Here is my code<br><br>import sys<br>from PyQt4.QtGui import*<br>
from PyQt4 import QtCore<br>from PyQt4 import Qt<br><br><br>import ui_F1 as MW<br><br>class App(QMainWindow,MW.Ui_Form):<br> def __init__(self,parent=None):<br> super(App,self).__init__(parent)<br> self.setupUi(self)<br>
flags=QtCore.Qt.Popup<br> flags |= QtCore.Qt.WindowTitleHint<br> self.subwindow.setWindowFlags(flags)<br> self.mdiArea.addSubWindow(self.subwindow)<br> self.subwindow.show()<br> self.connect(self, Qt.SIGNAL('triggered()'),self.closeEvent)<br>
<br><br> def closeEvent(subwindow,event):<br> subwindow.event.ignore()<br><br><br>if __name__ == "__main__":<br> app=QApplication(sys.argv)<br> form=App()<br> form.showMaximized()<br> app.exec_()<br>
<br>Many thanks,<br><br>Jothy<br></div>