[Qt-interest] Mdi area subwindow closed event invoke in main window

Radiceski, Darko D.Radiceski at aamgroup.com
Sun Aug 15 16:45:55 CEST 2010


 
Hi all,
 
I hope someone can help me with the following question:
 
I have a QT Gui application which has a QMdi area to which i add widgets
as sub windows:
 
_mMyDialog = new MyWidget();

_mMyDialog->setAttribute(Qt::WA_DeleteOnClose);

_mMdiArea->addSubWindow(_mMyDialog );

In the Widget that is now a subwindow to the mdi are i have a button
which when clicked i would like to close the widget/sub window and also
raise an event in the MainWindow that created the widget/subwindow that
will tell me that my close button has been clicked.

What is the best way to achieve that? In a nutshell i would like to know
when the subwindow is closed.

I have tried installing an event filter on the subwindow/widget and in
the event filter monitoring for the 

case QEvent::Close:

That does call the event when i close the widget but also gets invoked
by close on main window and so on. 

Also i have noticed that this event gets called twice even if i check
the type of qobject 

Any advice on this?

Thank you for your help.

 
Dan

Attention

Email Disclaimer Notice - This message is the property of AAM Pty Ltd. The information in this email is confidential and may be legally privileged.
It is intended solely for the
addressee. Access to this email by anyone else is unauthorised. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it is prohibited and may be unlawful.

If you have received this message in error please notify AAM Pty Ltd. immediately via email to mailadmin at aamgroup.com <mailto:mailadmin at aamgroup.com> 

This email has been scanned and cleared by NetIQ Mail Marshal, however AAM Pty Ltd does not guarantee this message free of viruses, or interference. 
________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100816/974fcd9a/attachment.html 


More information about the Qt-interest-old mailing list