[Qt-interest] Window modality

Harry Sfougaris hsfougaris at gmail.com
Tue Aug 10 15:34:04 CEST 2010


Investigating why I didn't get responses, I realized I I didn't reply to all..... :)
So here it goes again:
> 
>> If you want to show a window as modal, you must use exec() insted show method. 

No, it doesn't seem to need that. Since I am using the setWindowModality function, it doesn't seem to make a difference whether I use show() or exec().

I think the issue here is a more generic one: Does Qt::WindowModal work with QMdiSubWindow? If yes, I guess the next question is what's wrong with my code... :)
Also, under Windows, window-modal doesn't seem to work (of course there is no sheet dialog equivalent, but even the behavior doesn't seem to be there, ie everything seems to be application modal). Is this how it is?

Thanks,
Harry
> 
>> 
>> El 08-08-2010, a las 14:28, Harry Sfougaris <hsfougaris at gmail.com> escribió:
>> 
>>> I'm having a problem in properly using WindowModal.
>>> 
>>> I have a main window (instance of QMainWindow) in my app.
>>> I display a QDialog with just show() .
>>> For any child QDialogs created, if I specify them as WindowModal the dialog is displayed as a sheet dialog under OSX, which is what I would expect.
>>>      		MainDlg *mainDlg = new MainDlg(mainWindow);
>>>     	mainDlg->show();
>>>     	.....
>>>      		ChildDlg *childDlg = new ChildDlg(mainDlg);
>>> 		childDlg->setWindowModality(Qt::WindowModal);
>>> 	childDlg->show();
>>> 
>>> If however I add an mdiArea to my main window and add the first dialog to the mdiArea, the child dialogs are shown on the mainWindow and not on mainDlg.
>>>             
>>>      		MainDlg *mainDlg = new MainDlg(mainWindow);
>>>     	mdiArea->addSubWindow(mainDlg);
>>>     	mainDlg->show();
>>>     	.....
>>>      		ChildDlg *childDlg = new ChildDlg(mainDlg); // I tried this also with mainDlg->parentWidget()
>>> 		childDlg->setWindowModality(Qt::WindowModal);
>>> 	childDlg->show();
>>> 
>>>  Is this some sort of limitation, or am I doing something wrong?
>>> 
>>> Thanks,
>>> Harry
>>> _______________________________________________
>>> Qt-interest mailing list
>>> Qt-interest at trolltech.com
>>> http://lists.trolltech.com/mailman/listinfo/qt-interest
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100810/dc6a660a/attachment.html 


More information about the Qt-interest-old mailing list