QT对话框去掉帮助和关闭按钮

转载自 http://blog.csdn.net/liqunzheng/article/details/7409657

建了一个对话框,我不想把边框去掉,只想去掉关闭按钮,
setWindowFlags(windowFlags()&~Qt::WindowCloseButtonHint&~Qt::WindowContextHelpButtonHint);
结果那个问号的按钮去掉了,但是关闭按钮还在,求助啊

setWindowFlags(Qt::WindowTitleHint | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint);
这样就行了,哈哈!
 

setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint);
还是简单点好!

你可能感兴趣的:(QT对话框去掉帮助和关闭按钮)