[Qt-interest] X button does not close modeless dialog
Malyushytsky, Alex
alex at wai.com
Fri Sep 4 22:22:34 CEST 2009
Sorry I missed this helpful message first ( my e-mail client put it in separated thread for some reason).
It looks like that explicitly adding the Qt::WindowCloseButtonHint helps and dialog works as intended.
It is weird that without Qt::WindowMinimizeButtonHint it does too and used to work with QT 4.4.3 just fine.
But adding Qt::WindowCloseButtonHint seems fixes the problem.
Thanks for help,
Alex
-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Stephen Jackson
Sent: Friday, September 04, 2009 12:25 AM
To: qt-interest
Subject: Re: [Qt-interest] X button does not close modeless dialog
On Fri, Sep 4, 2009 at 3:40 AM, Malyushytsky, Alex wrote:
> Hi,
>
> After upgrading to QT 4.5.2 on Linux (CentOS, gcc, kde 3.5.4),
> my modeless dialogs stopped closing when user click x button at the top right corner of the dialog.
> Simple test code can be found in the zipped attachment.
> Build, run, click /Edit/Show Modeless dialog, click the X button.
>
> In short, all I do is creating an instance of the dialog with a few attributes.
> Also 3 functions are overridden. In example they are simply calling base class prototypes as below.
>
> FlexModelessDialogBase::FlexModelessDialogBase(QWidget * parent)
> : QDialog (parent, Qt::Dialog | Qt::WindowMinimizeButtonHint| Qt::WindowSystemMenuHint )
> {
> this->setAttribute( Qt::WA_DeleteOnClose );
> }
>
> I would appreciate, if anybody could test it and say, if the dialog is closing on his (Linux) system.
>
When I build and run your code on my Linux system (Kubuntu 9.04, Qt
4.5.1, kde 4.1.4), no close button appears on the title bar.
Furthermore, in the system menu, Close is disabled.
If I change your window flags to include Qt::WindowCloseButtonHint,
the close button then appears and works correctly. I suggest you try
this.
--
Regards,
Stephen Jackson
_______________________________________________
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