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

QTextDocument::toPlainText() replaces nbsp's with normal spaces

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.7.1
    • Fix Version/s: 5.9.0 Beta 2
    • Component/s: GUI: Text handling
    • Labels:
      None
    • Commits:
      3a9801d568e2f7d5a95ed4f5886a7f5062869456

      Description

      I am maintaining a text editor which uses QTextDocument. I have noticed that when a file contains non-breaking spaces, they are converted to normal spaces on saving.

      It looks like that happens in QTextDocument::toPlainText method. However that is not mentioned in the documentation, there is no comment about it in the source code, and git blame does not help because it traces to the initial commit in the Qt 4 repository.

      My question is: is this replacing still needed? And if yes, why?
      Can we have some API for getting the original text without replacing?

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              esabraha Eskil Abrahamsen Blomfeldt
              Reporter:
              mandriver Dmitry Shachnev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes