Search code examples
c++qt4.8

How I can hide ? icon of QWizard Dialog


I am using qt4.8 with c++ and Visual studio 2010..... I have a problem when I choose a ModernStyle Wizard, It has two default icons (?) and (x). I want to hide ? icon from my wizard.

Can anyone tell me how I can hide ? icon of QWizard Dialog........

I have a LicenseWizard class and this class inherit QWizard class I take a ModernStyle Wizard.

Now I want to hide the ? icon of this ModernStyle wizard........

If anyone know the solution please tell me..............


Solution

  • QWizard is inherited from QWidget via QDialog. A QWidget controls the visibility of the "?" Icon via flags. To remove the "?" you have to set all the Flags you want (except the one for "?").

    Window Flags list in the docs: http://qt-project.org/doc/qt-4.8/qt.html#WindowType-enum

    Example:

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