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

iOS - Changing focus of input widget does not shift up application correctly

    XMLWordPrintable

Details

    • iOS/tvOS/watchOS

    Description

      In iPad, while the keyboard is already visible, and when the focus of input widget is changed, the application is scrolled incorrectly.

      In my test app, when I open the dialog, the first line gets the focus, and the keyboard comes up

      .

      I then click on the third line edit which is very close to the keyboard. At this point, I would expect the application to be scrolled further up. However, it did not scroll up (see screenshot below)

      When I click back on the first line edit, the application then scroll up further.

       

      Root cause:

      In QWidget::setFocus, QWidgetPrivate::updateFocusChild is called before QApplicationPrivate::setFocusWidget. In  QWidgetPrivate::updateFocusChild, QIOSInputContext::scrollToCursor would be called which reads QApplication::inputMethod()::cursorRectangle(). However, the cursorRectangle is only updated correctly in QApplicationPrivate::setFocusWidget which would be called later on.

       

       

      Attachments

        1. dialog.h
          0.1 kB
        2. dialog.mm
          2 kB
        3. First.jpeg
          First.jpeg
          42 kB
        4. Second.jpeg
          Second.jpeg
          43 kB
        5. Third.jpeg
          Third.jpeg
          49 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            srutledg Shawn Rutledge
            nanthiran2005 sivan nanthiran
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes