Results 1 to 3 of 3

Thread: QMessageBox disabled the close button when you setStandardButtons(NoButton)!

  1. #1
    Join Date
    May 2012
    Posts
    11
    Qt products
    Qt4

    Default QMessageBox disabled the close button when you setStandardButtons(NoButton)!

    I have a QMessageBox, when I did the
    Qt Code:
    1. QMessageBox myBox = new QMessageBox();
    2. myBox.setStandardButtons(NoButton);
    3. myBox.exec();
    To copy to clipboard, switch view to plain text mode 
    the dialog's close button(on the upright corner of the dialog) will turn to be disable.
    How to enable the close button?

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QMessageBox disabled the close button when you setStandardButtons(NoButton)!

    Play with window flags.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    May 2012
    Location
    Bangalore, India
    Posts
    271
    Thanks
    29
    Thanked 50 Times in 47 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: QMessageBox disabled the close button when you setStandardButtons(NoButton)!

    Use:->
    Qt Code:
    1. myBox.setStandardButtons(QMessageBox::Close);
    To copy to clipboard, switch view to plain text mode 

    If you dont want anything on the widget then simply define one QWidget with empty widgets.
    Heavy Metal Rules. For those about to rock, we salute you.
    HIT THANKS IF I HELPED.

Similar Threads

  1. disable close button in QMessageBox
    By mentalmushroom in forum Qt Programming
    Replies: 9
    Last Post: 4th June 2011, 22:08
  2. Replies: 2
    Last Post: 6th May 2011, 09:02
  3. Replies: 2
    Last Post: 26th April 2011, 12:44
  4. How to add a a Button to a QMessageBox?
    By Bong.Da.City in forum Newbie
    Replies: 5
    Last Post: 29th August 2010, 21:02
  5. About QMessageBox close my tray application
    By Doles in forum Qt Programming
    Replies: 2
    Last Post: 19th July 2008, 22:27

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.