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

Wrong dialog activation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Need More Info
    • Priority: P2: Important
    • Resolution: Incomplete
    • Affects Version/s: 5.3.2
    • Fix Version/s: None
    • Component/s: QPA
    • Labels:
      None
    • Environment:
      OSX 10.10

      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:
              vestbo Tor Arne Vestbø
              Reporter:
              thierryb Thierry Bastian
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes