PDA

View Full Version : how to disable X button to close th window



raghvendramisra
16th July 2008, 15:28
I everyone,
I wanted to disable the X button at the top right corner of the page which is used to close the page.
how can i do this??????

Regards
Raghvendra

triperzonak
16th July 2008, 15:43
already asked..
http://www.qtcentre.org/forum/f-qt-programming-2/t-disable-close-button-x-of-a-qdialog-9348.html

3dch
5th February 2009, 20:01
With Qt 4.5 and MDI child windows you get rid of the close button with the following flags which must be supplied at the time when the MDI child window is added to the MDI area:



mychildwindow* child1 = new MyChildWindow(this);

Qt::WindowFlags flags;
flags = Qt::Window | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint;

mdiArea->addSubWindow(child1, flags);



Didn't try with top level widgets but this could work for them too.