PDA

View Full Version : QDialog without the close button in the top right corner



Morea
6th July 2007, 20:15
Hi.
How can I make a modal QDialog that doesn't have the "X" in the top right corner (in the title) that you can use to close the dialog?
I need to make it modal so that it doesn't let the user do anything (including closing the dialog) before it has finished doing stuff in the dialog.

By the way, the dialog can still send and receive signals when it's modal, right?

jpn
7th July 2007, 09:03
How can I make a modal QDialog that doesn't have the "X" in the top right corner (in the title) that you can use to close the dialog?
As far as I know, there is no 100% reliable way to do this (unless you provide a custom fake title bar). You can provide certain hints but it's up to the underlying window system whether they are respected or not. I suggest you take a look at the window flags example (http://doc.trolltech.com/4.3/widgets-windowflags.html). On the other hand, you can always ignore close events to prevent dialog from closing.


By the way, the dialog can still send and receive signals when it's modal, right?
Yes.