Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Remove OK button from QMessageBox?
Forum Updated to NodeBB v4.3 + New Features

[Solved] Remove OK button from QMessageBox?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 18.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CAD_codingC Offline
    CAD_codingC Offline
    CAD_coding
    wrote on last edited by
    #1

    Hi,
    I am creating a QMessageBox as below:

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

    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.

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      Did you try
      @msg->setStandardButtons(0);@

      ?

      157

      1 Reply Last reply
      3

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved