Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-11885

QMessageBox Button Default Button selection not honored

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.6.3
    • None
    • Red Hat Enterprise Linux 5, 64-bit, kernel 2.6.18-194.3.1.el5, with latest Red Hat Network patches applied as of 5/25/2010, running inside VMware Workstation 6.5.4 with 2 processors enabled.

    Description

      When using the critical, information, question, or warning static methods in the QMessageBox class to create a QMessageBox dialog and passing in a default button, the default button is not guaranteed to be the highlighted button when the dialog is shown.

      For example, the code:

      QMessageBox::question(this, tr("Confirm Exit"), tr("Do you really want to quit?"), QMessageBox::No | QMessageBox::Yes, QMessageBox::Yes);

      will display a QMessageBox where the "No" push button is highlighted instead of the "Yes" push button. It appears that the "Yes" push button is momentarily highlighted when the QMessageBox is displayed but that the focus immediately goes to the "No" push button without any user input. If the default button passed is QMessageBox::No, the "No" push button is correctly highlighted as the default. It appears that the left-most button always receives the focus regardless of the default button parameter value in the static method parameter list.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dedietri Gabriel de Dietrich (drgvond)
            marchand Dale Marchand
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes