You can use the following piece of code in your Qt Window to disable Close (“X”) button in the title bar.
setWindowFlags(Qt::Window
| Qt::WindowMinimizeButtonHint
| Qt::WindowMaximizeButtonHint);
Alternatively, you can use this code to enable it:
setWindowFlags(Qt::Window
| Qt::WindowMinimizeButtonHint
| Qt::WindowMaximizeButtonHint
| Qt::WindowCloseButtonHint);
As you can see, WindowCloseButtonHint flag is responsible for enabling/disabling Close button in title bar.
Is there a way to set this in Qt Creator?
No really. Not yet.