Important: Please read the Qt Code of Conduct -

[Solved] Remove OK button from QMessageBox?

  • Hi,
    I am creating a QMessageBox as below:

    @QMessageBox *msg = new QMessageBox();
    msg->setText("My Text");
    msg->setTitle("My Title");

    By default it is showing the OK button.
    I want to remove that button.
    In fact I do not want any button.
    What is the function to do this?
    I have tried removing it by using buttons() to get a list of buttons & then removing them but this does not work.

  • Moderators


    Did you try


Log in to reply