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

Position and size of QMessageBox are wrong...

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15.13, 6.6.2
    • Fedora 39
      Qt Creator 12.0.2
    • Linux/Wayland

    Description

      QMessageBox are not centered on parent and the size computed incorrectly (title is cut or hidden)

      1. The message box displayed next to the top left corner of the client area of its parent and the title text is cut

      QMessageBox::question(this, "Exit", "Are you sure?", QMessageBox::Yes | QMessageBox::No); 

      2. Same like before (1)

       

      QMessageBox msg2;    
      
      msg2.setParent(this);
      msg2.setText("Are you sure?");
      msg2.setWindowTitle("Exit");
      msg2.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
      msg2.setDefaultButton(QMessageBox::No);
      msg2.setIcon(QMessageBox::Question);
      msg2.setWindowFlags(Qt::Dialog);    
      
      msg2.exec();
       

      3. This shows centered on the parent but there is no title bar at all

       

       

      QMessageBox msg1;    
      
      msg1.setParent(this);
      msg1.setText("Are you sure?");
      msg1.setWindowTitle("Exit");
      msg1.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
      msg1.setDefaultButton(QMessageBox::No);
      msg1.setIcon(QMessageBox::Question);
      msg1.setWindowFlags(Qt::Popup);    
      
      msg1.exec();
       

      After posting on the forums it seems that the main line if a problem between Qt and Wayland...

       

      Forum post

      I have no means to check it on other platforms, but I believe that if it was a problem on all or most I would find a mention of it...

      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
            kepeter Peter Eliyhau Kornfeld
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes