[Qt-interest] Window modality

Harry Sfougaris hsfougaris at gmail.com
Sun Aug 8 20:28:05 CEST 2010


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100808/e37cda0d/attachment.html 


More information about the Qt-interest-old mailing list