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

Window with WindowStaysOnTopHint covers its modal child dialog on Mac

    XMLWordPrintable

Details

    • macOS
    • 85ff4e8fe473337c687a4ee8afc4b3ca4f96f7b7

    Description

      Trying to move to Qt 5.2 from 4.8.5. Main window has WindowStaysOnTopHint flag, another modal dialog blocks interacation with main window, but is displayed underneath it. This behaviour didn't appear in Qt 4 and child dialogs "inherited" on-top behaviour.

      Setting WindowStaysOnTopHint to the child dialog doesn't help.

      The issue can be quickly reproduced with a couple of code lines. Please see the code below and the complete project is also attached.

      #include <QMessageBox>
      
      MainWindow::MainWindow(QWidget *parent) :
          QMainWindow(parent),
          ui(new Ui::MainWindow)
      {
          ui->setupUi(this);
      
          connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(onClicked()));
      
          setWindowFlags(windowFlags() | Qt::WindowStaysOnTopHint);
      }
      
      MainWindow::~MainWindow()
      {
          delete ui;
      }
      
      void MainWindow::onClicked()
      {
          QMessageBox::information(this, "Title", "String");
      }
      

      Attachments

        1. QtMacTopmostTest.zip
          2 kB
        2. shot.png
          shot.png
          48 kB

        Issue Links

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

          Activity

            People

              sgaist Samuel Gaist
              crystalidea Steven (crystalidea)
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes