Qt - Disabling QDialog's “?” button

前端 未结 4 696
旧巷少年郎
旧巷少年郎 2021-02-07 01:15

I create an instance of QDialog and on the left of \'x\' (close) button i have also \'?\' button. How I can disable that \'?\' ?

4条回答
  •  误落风尘
    2021-02-07 02:08

    From the Qt 4.6 QDialog documentation:

    QDialog::QDialog ( QWidget * parent  = 0, Qt::WindowFlags  f = 0 )
    

    Constructs a dialog with parent parent.

    A dialog is always a top-level widget, but if it has a parent, its default location is centered on top of the parent. It will also share the parent's taskbar entry.

    The widget flags f are passed on to the QWidget constructor. If, for example, you don't want a **What's This button in the title bar of the dialog**, pass Qt::WindowTitleHint | Qt::WindowSystemMenuHint in f.

    See also QWidget::setWindowFlags().

提交回复
热议问题