Disable QDialogs default close button (upper left “cross button”)?

 ̄綄美尐妖づ 提交于 2019-11-30 05:58:19

问题


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


回答1:


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.




回答2:


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




回答3:


Use this function for your dialog

dlgLobLobLob->setWindowFlags(Qt::Dialog | Qt::Desktop)



回答4:


Try setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowTitleHint); . You may want to check the Window Flags Example, and play around to see effects of all possible combinations of WindowFlags



来源:https://stackoverflow.com/questions/9965224/disable-qdialogs-default-close-button-upper-left-cross-button

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!