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

Wrong dialog activation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • 5.15.7, 6.2.1, 6.3.0 Alpha
    • 5.3.2, 5.15, 6.2.0 Beta4
    • QPA
    • None
    • OSX 10.10
    • macOS
    • 7c26d7f482b9c15cc6ff850d5954151031010226 (qt/qtbase/dev) 8e22ea578cf92a19f8d07383655a294aa352d5b4 (qt/tqtc-qtbase/5.15) ae1921b0ea15435159dffb29b69ac2504b2932bd (qt/qtbase/6.1) bf70b362194c922f3abc065e4f164a4bb40a94b1 (qt/qtbase/6.2)

    Description

      If you run the following code, you get a main dialog, click on it and you get a Dialog. Click on that dialog, you get a QColorDialog. When the QColorDialog is closed, I'd expect my QDialog to get activated/focused/raised. But it gets behind my main dialog and the main dialog gets the focus.

      #include <QtWidgets>
      class Dialog: public QDialog
      {
      public:
          Dialog(QWidget *parent) : QDialog(parent, Qt::Window)
          {
              setWindowTitle(tr("sub dialog"));
          }
      
          void mousePressEvent(QMouseEvent *)
          {
              QColorDialog::getColor();
          }
      
      };
      
      class MainDialog : public QMainWindow
      {
      public:
          MainDialog()
          {
              setWindowTitle(tr("main dialog"));
          }
      
          void mousePressEvent(QMouseEvent *)
          {
              Dialog *dlg = new Dialog(this);
              dlg->show();
          }
      
      };
      
      int main(int argc, char **argv)
      {
      QApplication app(argc, argv);
      MainDialog dlg;
      dlg.show();
      return app.exec();
      }
      

      Attachments

        1. Bildschirmaufnahme 2022-09-07 um 21.54.08.mov
          2.76 MB
          Sebastian Beckmann
        2. Bildschirmaufnahme 2022-11-08 um 23.15.15.mov
          2.56 MB
          Sebastian Beckmann
        3. QTBUG-42661.zip
          6 kB
          Sebastian Beckmann
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            dorisverria Doris Verria
            thierryb Thierry Bastian
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            5 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated: