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

前端 未结 4 1730
臣服心动
臣服心动 2020-12-10 03:51

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

相关标签:
4条回答
  • 2020-12-10 04:30

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

    0 讨论(0)
  • 2020-12-10 04:36

    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

    0 讨论(0)
  • 2020-12-10 04:44

    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.

    0 讨论(0)
  • 2020-12-10 04:50

    Use this function for your dialog

    dlgLobLobLob->setWindowFlags(Qt::Dialog | Qt::Desktop)
    
    0 讨论(0)
提交回复
热议问题