Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable QDialogs default close button (upper left "cross button")?

Tags:

c++

qt

qdialog

Is it possible to disable/delete the QDialogs default close button at the upper left of the dialog?

like image 738
Streight Avatar asked Apr 01 '12 14:04

Streight


2 Answers

At least in (embedded) Linux, you can do this:

setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::CustomizeWindowHint);

With that, I get a window which has the title but no buttons.

like image 188
user3912842 Avatar answered Oct 23 '22 09:10

user3912842


Clearing WindowCloseButtonHint in WindowFlags may do what you want. Check out the example here.

like image 41
Stephen Chu Avatar answered Oct 23 '22 07:10

Stephen Chu