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

Long press textfield popup teleports after being drawn for the first time

    XMLWordPrintable

Details

    • Android
    • 51d331b13 (dev), 69c4d9a19 (6.5), b32f16b16 (6.6), 41eebd477 (tqtc/lts-6.2)
    • 2023wk32FOQtforAndroid, 2023wk34FOQtforAndroid

    Description

      Description

      After long pressing some text in a QML Textfield item, the pop-up that appears is first drawn at the incorrect coordinates, and is then moved to the correct coordinates. This results in a quick flicker of the popup in the wrong position after which it gets drawn in the correct area. Also occurs if you have something on your clipboard to paste to the field and long-press on an empty field, since it is the same popup.

      Cause seems to be that the EditMenuPopup.java class uses its width to calculate its positioning, but does not know the width of its layout when it is drawn for the first time, so the width is 0, and only gets updated afterwards in the onLayoutChange callback, where the size is actually updated to be correct. Quickly modifying the code to remove the centering portion fixes the teleportation, so it seems likely that this is the cause.

      Possible fix would be to use anchoring or gravity or something like that to center the popup, that way we don't need to take the width of the element into account manually at all.

      Steps

      1. Long press on some textfield or textarea on an android device or emulator
      2. Observe the popup closely

      Attachments

        Issue Links

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

          Activity

            People

              bartlomiejmoskal Bartlomiej Moskal
              pevirkku Petri Virkkunen
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes