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

QPlainTextEdit doesn't show the first word if placeholderText is set

    XMLWordPrintable

Details

    • e1a073044855c43ca11e9ada6eedded199c02fc8

    Description

      QPlainTextEdit shows the placeholderText even when you input text until a space character is inserted. Then the whole word is added to the edit. Similarly if you delete the space the remaining text is replaced with placeholderText.

      This happens at least on Android and probably on other platforms with predictive text inputs. I believe the reason is that the input is in pre-edit mode and therefore the editor doesn't see the input. The problem is not reproducible in QTextEdit or in QLineEdit. Those two check that QWidgetTextControl::isPreediting() is false when showing the placeholderText while QPlainTextEdit doesn't check the value.

      See the attached screenshot (qtbug_qplaintextedit.PNG): The predictive text shows some text, but the PlainTextEdit placeholderText is shown in the editor. Then pressing space key the text shows up in the editor.

      Attaching also the test app.

      Attachments

        1. qtbug_qplaintextedit.PNG
          53 kB
          Qt Support
        2. qtbug61210.zip
          2 kB
          Qt Support
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            liaqi Liang Qi
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes