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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Invalid
    • Affects Version/s: 4.7.1
    • Fix Version/s: None
    • Component/s: (Inactive) EGL/Symbian
    • Labels:
      None
    • Environment:
      Nokia N97 mini using Qt 4.7.1-built app on 4.7.1
    • Platform/s:
      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

        1. Video0017.mp4
          4.68 MB
          Tam Hanna
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            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