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

Inconsistent Android text edit cursor appearance with QQuickItem which has QQuickItem::ItemAcceptsInputMethod flag set

    XMLWordPrintable

Details

    • Android
    • Next

    Description

      With Qt 5.15, the text edit cursor (the droplet) on Android appears to top left corner if one is using a subclass of QQuickItem which has QQuickItem::ItemAcceptsInputMethod flag. This cannot be customized because there ain't cursorDelegate because it is not a sub class of a text edit (or similar).

      QQuickItem::ItemAcceptsInputMethod indicates that the item supports text input methods which (as far as I understand) on Android means that when Item gains focus, the text edit cursor (blue droplet) will emerge but this is not desirable in a use case where there is need to capture keyboard events on C++ layer over a QML Item which already has MouseArea on it but QQuickItem does not have a field for text input.

      Behavior was the the same in Qt 6.1.3 but since Qt 6.2 the behavior has changed and the blue droplet only flashes when the flag is toggled. Making this behavior inconsistent between versions. Optimally the droplet should not flash at all, so I would consider this a bug too. This inconsistency actually makes me believe this is a bug in both cases.

      Setting QT_QPA_NO_TEXT_HANDLES=1 as an environment variable can be used to make the droplet not being used but this means there will be no text handles at all in the android app even if they are wished to be used elsewhere.

      Therefore for such use case the current behavior in Qt 5.15 and behavior in Qt makes very little sense and it would be good if use of those text cursors could be made at least optional and easily controllable per item when ItemAcceptsInputMethod is set for QQuickItem.

      Way to reproduce:
      Attached you can find an example which uses subclass of QuickItem which on touch gains activeFocus and the "blue droplet" appears when app is built with Qt 5.15.8 and run on android.

      Flashing of "droplet" in Qt 6.2.4:
      Touch the pink rectangle containing text edit.
      Press 'SET FLAG' button and the android text edit handle flashes for a short time.

      Attachments

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

        Activity

          People

            qtandroidteam Qt Android Team
            foxxx Tuukka Kettunen
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes