Results 1 to 5 of 5

Thread: Order of buttons in QMessageBox

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2014
    Location
    Holland
    Posts
    4
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Order of buttons in QMessageBox

    Hello,
    I am just started with Qt Programming with help of the book "The Book of Qt4" by Daniel Molkentin.
    In chapter 4, there's an example of cuteeditor a simple texteditor.
    I use the example and when I try the next line:
    Qt Code:
    1. if (QMessageBox::question(this, tr("Save Document?"),
    2. tr("You want to create a new document, but the "
    3. "changes in the current document '%1' have not "
    4. "been saved. How do you want to proceed?"),
    5. tr("Save Document"), tr("Discard Changes") ))
    To copy to clipboard, switch view to plain text mode 
    The resulting Box:
    Screenshot from 2014-12-16 21:57:51.png
    The text "Save Document" is in the left button and the text "Discard Changes" in the right button. When I click on the right button, the save document dialog appears. It is easily to change the order of the text of the buttons, but how do I know what is the yes-button and what is the no-button. And second question: how can I check what's the return value of MessageBox::question for a button. It seems that is a boolean (yes button true and no button false?) but I cannot find a static method question of MessageBox with a boolean return value.
    Last edited by martin72; 16th December 2014 at 21:19.

Similar Threads

  1. QMessageBox - Text in the buttons
    By graciano in forum Qt Programming
    Replies: 4
    Last Post: 20th June 2015, 23:51
  2. QMessageBox custom buttons icons
    By asik in forum Newbie
    Replies: 2
    Last Post: 2nd December 2010, 16:37
  3. tab order not working properly for radio buttons
    By netmat in forum Qt Programming
    Replies: 1
    Last Post: 1st April 2010, 14:58
  4. QMessageBox buttons appearance
    By yartov in forum Qt Programming
    Replies: 6
    Last Post: 26th June 2008, 01:36
  5. Replies: 3
    Last Post: 25th April 2007, 12:43

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
  •  
Qt is a trademark of The Qt Company.