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

QPlainTextEdit - placeholderText longer than one line in widget is clipped to single-line paint region

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4: Low P4: Low
    • None
    • 5.5.1
    • None
    • 64-Bit Linux (Debian Distribution but On-Line installer version not system packages)

      I think there is an issue with the paint code for at least the QPlainTextEdit class (I have not checked QTextEdit but as the paint code for that must be more complex to handle marked-up text it is unclear whether that would be affected as well or not) - IF the background is set to be visible (so that it is possible to see the extend of the text in the edit and to distinguish between that and the background of the underling widget) AND a placeholderText is longer that will fit on one-line in the widget THEN the background region is not extended beyond a single text line and the placeholder text is clipped to that background.

      It is a debatable point as to whether the "text" background region should end at EITHER: the right side of the widget OR: at the point where a document terminating marker (not the ¶

      {pilcrow}

      but a ¤

      {currency marker}

      though Qt does not use/offer THAT) would be if visible whitespace indicators are to be displayed and are relevant to "placeholder" type text.

      I have been experimenting with displaying those "visual" tabs/spaces and linefeed/paragraph marks with QTextOption::Flags and noted also the end-of-line markers are not consistently showing - but that is probably a separate ticket issue!

      I guess these particular issues are fairly new as originally the placeholderText was a QLineEdit feature and was only "ported" to the multi-line edit widgets a few releases ago (Qt 5.2 I believe)?

      I attach two images from the same widget in my application with two different placeholder texts of lengths which display this bug.

      {The people responsible for this reporting system may wish to note that I did not insert any "line-spacing" around those two non-ASCII symbols, the Pilcrow and the Currency marker above - they were entered in a single unbroken sentence - the breaks that have been inserted to break up that paragraph as displayed here are due to something mishandling my Unicode input IMHO!}

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            slysven Stephen Lyons
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes