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

Message box not centered on resized and maximized QMainWindow

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.2, 6.1.0
    • None
    • Arch Linux 64-bit
      Microsoft Windows 10 Pro 20H2
    • Linux/X11, Windows

    Description

      #include <QApplication> 
      #include <QMainWindow> 
      #include <QMessageBox> 
      
      int main(int argc, char *argv[]) 
      { 
          QApplication a(argc, argv); 
          QMainWindow w; 
          w.resize(800, 600); 
          w.showMaximized(); 
          QMessageBox::question(&w, "Title", "Text", QMessageBox::Yes | QMessageBox::No); 
          return a.exec(); 
      }
      

      The message box is not shown centered on the main window. The issue does not affect Qt 4.8.7.

      Attachments

        Issue Links

          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
              net147 Jonathan Liu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes