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

Wrong dialog activation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.3.2, 5.15, 6.2.0 Beta4
    • Fix Version/s: 5.15.7, 6.2.1, 6.3.0 Alpha
    • Component/s: QPA
    • Labels:
      None
    • Environment:
      OSX 10.10
    • Platform/s:
      macOS
    • Commits:
      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

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

          Activity

            People

            Assignee:
            dorisverria Doris Verria
            Reporter:
            thierryb Thierry Bastian
            PM Owner:
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Dates

              Created:
              Updated: