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

Touch events not fired after QDialog closed with ESC, ⌘-. or Return

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.1.1, 5.2.0 Beta1
    • None
    • OS X 10.9
    • macOS

    Description

          Application* applicationInstance = Application::getInstance();
          QDialog* dialog = new QDialog(applicationInstance->getWindow());
          dialog->setWindowTitle("Login");
          
          QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom);
          dialog->setLayout(layout);
          
          QFormLayout* form = new QFormLayout();
          layout->addLayout(form, 1);
          
          QString username = applicationInstance->getProfile()->getUsername();
          QLineEdit* usernameLineEdit = new QLineEdit(username);
          usernameLineEdit->setMinimumWidth(QLINE_MINIMUM_WIDTH);
          form->addRow("Username:", usernameLineEdit);
          
          QDialogButtonBox* buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
          dialog->connect(buttons, SIGNAL(accepted()), SLOT(accept()));
          dialog->connect(buttons, SIGNAL(rejected()), SLOT(reject()));
          layout->addWidget(buttons);
          
          int ret = dialog->exec();
          
          if (ret == QDialog::Accepted) {
              if (usernameLineEdit->text() != username) {
                  // there has been a username change
                  // ask for a profile reset with the new username
                  applicationInstance->resetProfile(usernameLineEdit->text());
              }
          }
          
          delete dialog;
      

      The dialog created by the above code, when closed via ESC or Return causes the Application to stop receiving multi-touch events (from a bluetooth magic trackpad or the embedded trackpad in Macbook Pro). This does not occur if the dialog is closed using the buttons on it.

      If the dialog is re-opened and then closed with the buttons the multi-touch works again (suggesting that something in the cleanup routine of having been closed this way kicks it back into the right state).

      Also tested with a very simple QMessageBox and experienced the same behaviour, so this does not appear to be specific to QDialog.

      Attachments

        For Gerrit Dashboard: QTBUG-34577
        # Subject Branch Project Status CR V

        Activity

          People

            srutledg Shawn Rutledge
            birarda Stephen Birarda
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes