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

Unable to create two topmost windows

    XMLWordPrintable

Details

    • c5b7a3c922ef7dcd7d3c670ea1dd318e27d53d51

    Description

       

      Running the following code on Windows has 'c' (the first window being shown) end up as a 'normal' window (and not a top-most window, like you would expect).

      #include <QApplication>
      #include <QWindow>
      #include <QTimer>
      #include <QDebug>
      
      int main(int argc, char *argv[])
      {
          QApplication a(argc, argv);
          QWindow b;
          QWindow c;
          b.setFlag(Qt::WindowStaysOnTopHint);
          c.setFlag(Qt::WindowStaysOnTopHint);
          b.setPosition(1200,700);
          c.setPosition(1280,720);
          c.show(); // <- is not a topmost window
          b.show(); // <- is a topmost window
      
          return a.exec();
      }
      
      
      

       

      I played around a bit and the changes made in the following patch fixes the issue. Although I don't know if it will break other things (dialogs, prompts, etc). But at least it can serve as inspiration.

      https://codereview.qt-project.org/207498

       

       

      Attachments

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

        Activity

          People

            manordheim Mårten Nordheim
            manordheim Mårten Nordheim
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes