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

Blue overlay is sometimes drawn over a QML TextEdit

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.2
    • Extras: Android
    • None
    • Android (Chromebook)
    • Android

    Description

      Sometimes Android draws a blue (highlight) overlay over the QtTextEdit (QtTextEdit.java)  which is used behind the scenes to capture input method events for the QML TextEdit. This seems to occur especially in the case a hardware keyboard is used.

      Note that this blue highlight does not move (or disappear) correctly in case the QML TextEdit is moved (or hidden).

      Possible solution

      Disable the default focus highlight in java (QtTextEdit.java):

      public QtEditText(Context context, QtActivityDelegate activityDelegate)
      {
      ...
          if (android.os.Build.VERSION.SDK_INT >= 26)
            setDefaultFocusHighlightEnabled(false);
      ...
      }
      

      The SDK version check is used as setDefaultFocusHighlightEnabled is introduced in API 26. I'm not sure if this problem occurs before this API version.

      Another solution may be to avoid focussing the QtTextEdit in case a hardware keyboard is used. (see QtActivityDelegate.java: m_editText.requestFocus(); ). However this seems to be error prone in case the user switches between hardware and software keyboard.

       

      Attachments

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

        Activity

          People

            qtandroidteam Qt Android Team
            m3197d - -
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes