Qt - Disabling QDialog's "?" button

Change the window flags, for example in the constructor:

this->setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint);

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().

Tags:

C++

Qt

Qdialog