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

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

    XMLWordPrintable

    Details

    • Commits:
      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

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

          Activity

            People

            • Assignee:
              liaqi Liang Qi
              Reporter:
              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