[Qt-interest] Uncloseable QMdiSubWindow?
Malyushytsky, Alex
alex at wai.com
Tue May 11 09:48:43 CEST 2010
It looks like if addSubWindow adds widget which is QMdiSubWindow, the flags are overridden or ignored.
I would consider this a bug, but fortunately there is simple work around.
All you need is to change the flags after addSubwindow is called as below:
QMdiSubWindow *child = new QMdiSubWindow();
mdiArea->addSubWindow(child, Qt::CustomizeWindowHint |Qt::WindowTitleHint| Qt::WindowMinMaxButtonsHint );
// without line below X button is still shown
child->setWindowFlags( Qt::CustomizeWindowHint |Qt::WindowTitleHint| Qt::WindowMinMaxButtonsHint );
// When line above is added
child->show();
You still might want to to handle closeEvent, but this should fix appearance as expected.
Have fun,
Alex
-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Rui Maciel
Sent: Monday, May 10, 2010 6:33 PM
To: qt-interest at trolltech.com
Subject: Re: [Qt-interest] Uncloseable QMdiSubWindow?
Malyushytsky, Alex wrote:
> Try to set the flags when you call mdiArea->addSubWindow as in my example
> below.
>
> Alex
Unfortunately that also doesn't work. The MDI subwindow still appears with the dreaded (x)
Thanks anyway,
Rui Maciel
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.
“This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you.”
“Please consider our environment before printing this email.”
More information about the Qt-interest-old
mailing list