[PyQt] How to get the event of child widget

Jothybasu K Selvaraj jothybasu at gmail.com
Wed Apr 21 11:43:24 BST 2010


Hi all,

I am trying to ignore the close event of a subwindow, but I don't know how
to do that.

Expecting for your suggestions.

Here is my code

import sys
from PyQt4.QtGui import*
from PyQt4 import QtCore
from PyQt4 import Qt


import ui_F1 as MW

class App(QMainWindow,MW.Ui_Form):
    def __init__(self,parent=None):
        super(App,self).__init__(parent)
        self.setupUi(self)
        flags=QtCore.Qt.Popup
        flags |= QtCore.Qt.WindowTitleHint
        self.subwindow.setWindowFlags(flags)
        self.mdiArea.addSubWindow(self.subwindow)
        self.subwindow.show()
        self.connect(self, Qt.SIGNAL('triggered()'),self.closeEvent)


    def closeEvent(subwindow,event):
        subwindow.event.ignore()


if __name__ == "__main__":
    app=QApplication(sys.argv)
    form=App()
    form.showMaximized()
    app.exec_()

Many thanks,

Jothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100421/6a8f6288/attachment.html>


More information about the PyQt mailing list