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

QPlainTextEdit crashes when using IME on Android

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.15.2
    • None
    • Build with Qt5.15.2 and Android SDK 31
      Run on Android 8.1.0
      The IMEs are com.tencent.qqpinyin and com.sohu.inputmethod.sogou.xiaomi
    • Android

    Description

      Hi there.

      This issue happens if the cursor reaches the the bottom of the QPlainTextEdit. If the current line have N spaces left(see testcase1_1.jpg and testcase2_1.jpg), and I input N+1 or more characters in the IME(see testcase1_2.jpg and testcase2_2.jpg), the application will crash when I confirm the input.

      This issue doesn't happen if I paste a piece of text with N+1 characters in it.

      The traceback file shows that something might be wrong in QTextLine::naturalTextRect()

      I've tested it on two different IMEs and got the same result.

      Steps to reproduce:

      1. build an application on Android with a QPlainTextEdit in it, then run it.
      2. Keep typing something in the QPlainTextEdit until the cursor reaches the bottom.
      3. Type something and keep N spaces in the current line.
      4. Type N+1 characters in the IME
      5. confirm the input in the IME, then the application crashes.

      I've created a minimal project with .pro.user file in it to reproduce this issue(see qtbug.zip). I hope it helps.

      Attachments

        1. android-build-debug.apk
          7.12 MB
        2. backtrace1.txt
          20 kB
        3. bugreport.png
          bugreport.png
          24 kB
        4. qtbug.zip
          4 kB
        5. testcase1_1-1.jpg
          testcase1_1-1.jpg
          690 kB
        6. testcase1_2-1.jpg
          testcase1_2-1.jpg
          713 kB
        7. testcase2_1-1.jpg
          testcase2_1-1.jpg
          753 kB
        8. testcase2_2-1.jpg
          testcase2_2-1.jpg
          760 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            wh201906 wh201906 wh201906
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes