问题
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