Important: Please read the Qt Code of Conduct -

Remove ? button QMessageBox

  • Hello,

    I try to create a messagebox without the help button but I can't get it to go away...

    mybox = new QMessageBox(QMessageBox::Information, "title", "messagebox", QMessageBox::Ok, this, Qt::WindowCloseButtonHint);

    With QDialog I set the window flags to closebuttonhint and it's enough to get rid of the help button but it doesn't work with message boxes...

  • Hi,
    you can try this.

    QMessageBox *msgBox = new QMessageBox(QMessageBox::Information,"title","messagebox " , QMessageBox::Ok,this);

  • hi

    try this, but rid of all buttons, icon and system menu...

    QMessageBox msg(QMessageBox::Information, "title", "messagebox", QMessageBox::Ok, this);
    msg.setWindowFlags(Qt::Dialog | Qt::WindowTitleHint | Qt::CustomizeWindowHint);

  • Neither works.... It works if you use the static function but then it uses exec() which is not what I want because it blocks application flow.. I need to be able to call show() instead...

Log in to reply