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

grabKeyboard() affects ALL FORMS, even after containing control dies

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 4.7.1
    • (Inactive) EGL/Symbian
    • None
    • Nokia N97 mini using Qt 4.7.1-built app on 4.7.1
    • Other

    Description

      Hello Folks,
      I am sorry to bug you with yet another really complex issue. However, I have an app with two forms. The first one initializes as follows:
      CGPIN::CGPIN(QString _message, QWidget *parent)
      : QDialog(parent)
      {
      ui.setupUi(this);

      ...

      ui.TxtPIN->setValidator( new QIntValidator(this) );
      ui.TxtPIN->grabKeyboard(); //THIS LINE

      showMaximized();
      }

      The form is then closed with close();, and another one is opened. In the other one, no keyboard events arrive to the keyPressedEvent handler even though the form, which grabbed the keyboard in the first place is long dead.

      So the issue is this: once a grabKeyboard is issued, even if the control which grabbed the keyboard dies, the grab is maintained!

      I will shortly upload a video explaining more.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            tamhanna Tam Hanna
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes