Hi,
Just wondering how to hide the close button on a QDialog?
Thanks
Brendan
Hi,
Just wondering how to hide the close button on a QDialog?
Thanks
Brendan
By modifying flags set on the widget. Just be aware this will only hide the button, it won't prevent your dialog from being closable.
grantbj74 (27th September 2011)
Thanks.
I looked at the Window Flags Example in Qt Assistant. Unfortunately Qt::SubWindow wasn't included and this was the only flag that hid the close button.
This is what worked in the end, I put it in the dialog constructor.
Qt Code:
this->setWindowFlags(Qt::SubWindow);To copy to clipboard, switch view to plain text mode
No, that's not a good approach. You need to use Qt::CustomizeWindowHint and remove Qt::WindowCloseButtonHint from the hints passed to the window.
Bookmarks