PDA

View Full Version : setWindowModality doesn't work



dude
15th February 2008, 13:49
Hi everybody!

I'm trying to make my dialogs modal with flag Qt::WindowModal.
The parent window is dialog also, shown by calling its slot show(), so the main window is non-modal itself. The children dialogs call setWindowModality(WindowModal) in their ctors. And when I show those dialogs by calling show() they appear non-modal.

Am I missing something? How can I force those dialogs to be modal?

jpn
15th February 2008, 13:53
How about simply using QDialog::exec() instead of show()?

dude
15th February 2008, 14:03
Can't do that because of a complex app architecture. It will hung the rest of app while that dialog will be shown

dude
15th February 2008, 14:11
It's weird but modality began to work properly when I made the line setWindowModality the first line of dialog ctor :eek: