PDA

View Full Version : How to block the normal buttons of a QWidget



Momergil
29th December 2011, 15:25
Hello!

I want to block thoose normal buttons that appears in a QWidget (the "?" and the "X"), so when the user wants to close the widget, he would have to use the buttons I personally put there to be used (the "OK" in my example).

7209

How do I do that?

By the other hand, a curiosity: which is the signal that is emitted when this same buttons are clicked? (the "?" and "X") or how can I capture they "clicking" so I can do some things to my object when they are clicked? (In fact, its because I don't know how to capture they being clicked that I want to block them =]).


Thanks!


Momergil

Lesiok
29th December 2011, 16:42
Read about QWidget and Qt::WindowFlags

stampede
29th December 2011, 16:44
Check out the QWidget::setWindowFlags (http://developer.qt.nokia.com/doc/qt-4.8/qwidget.html#windowFlags-prop), read about Qt::CustomizeWindowHint, Qt::WindowCloseButtonHint and Qt::WindowMinMaxButtons.

Momergil
4th January 2012, 12:32
Thanks!

Momergil