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

[REG 5.15->6.5] QGraphicsTextItem Pressing Enter on selection does not clear it

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5
    • GUI: Text handling
    • None
    • Windows

    Description

      In a QGraphicsTextItem, if you make a selection on a normal text, or empty lines, or almost any combination of them, then press Enter, the selection in cleared and replaced by a new line that is added at the end of the cursor location (prior to selection). Expected.

      If you make a selection that includes text and an empty line (or more)  (content where an empty block is at the end of the selection), then press Enter, the "remove()" functions are not called. The QWidgetTextControlPrivate::insertParagraphSeparator() function is called instead, with the strange side effect that not only the inserted line (from pressing Enter) loses all formatting, but also the previous text block, which had some valid formatting prior to deletion.

      So:

      • the selected text is not removed;
      • the selected lines (as many as they are) are not removed;
      • a line is added (expected)
      • the line has invalid formatting 
      • the previous block of text loses formatting
      • functions such as QTextCursorPrivate::remove() and QTextFramePrivate::remove_me() are never called (they are called when the new line removes content where an empty block is not at the end of the selection).

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            Thalia Mihaela Gaspar
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes