How to Disable the QDialog's Close Button?



  • How to disable the QDialog's "X" close button. And Also I want to Remove "?" Help Button from a QDialog. I know setWindowsFlags will work. But that makes a frameless dialog. I dont want a frameless dialog. The close button should be there. When u click it, it should not do any action.



  • This might help you..

    @setWindowFlags(((yourDialog->windowFlags() | Qt::CustomizeWindowHint) & ~Qt::WindowCloseButtonHint & ~Qt::WindowContextHelpButtonHint) );@


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.