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

Native QMessageBox ignores custom text on Standard buttons

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.0, 6.5.2
    • None
    • macOS

    Description

      When creating a message box and setting the text of its standard buttons the displayed native buttons still show the default text.

       

      #include <QApplication>
      #include <QMessageBox>
      #include <QPushButton>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);    
          QPushButton btn;
          btn.setText("Show msg box");
          btn.show();
          QObject::connect(&btn, &QPushButton::clicked, []{
              QMessageBox box;
              box.setStandardButtons(QMessageBox::Yes);
              box.button(QMessageBox::Yes)->setText("Hello World!");
              box.exec();
          });    
          return a.exec();
      }

       

       

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            madwinter Marcus Tillmanns
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes