Results 1 to 2 of 2

Thread: QTextEdit End-of-Line character

  1. #1
    Join Date
    Jul 2010
    Location
    United States
    Posts
    13
    Thanks
    4
    Qt products
    Platforms
    Unix/X11 Windows

    Default QTextEdit End-of-Line character

    FYI - I am using PyQt4

    I am loading a simple text file into a QTextEdit. I have noticed that when I try to read back each block of text it never returns the end-of-line character when I print repr(block.text()), where block is my QTextBlock for a given line.

    I physically printed each character at every position in the QTextEdit and saw that, where the new line character ('\n') was in the text file, the QTextEdit replaced with 0x2029, the paragraph separator. Is there a way to make the QTextEdit place the physical newline character in the document? I want to be able to figure out which type of End-of-line character is on each line of text, since a text document could have any one of the three types of EOL characters.

    Thanks for any help

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QTextEdit End-of-Line character

    As long as I know, QTextEdit transform all line endings to "\n". So you cant figure out, what line ending was used originally. After saving the editor contend back you always have a single \n.

  3. The following user says thank you to Lykurg for this useful post:

    smhall316 (30th September 2010)

Similar Threads

  1. How to get current character from QTextEdit
    By iamjayanth in forum Qt Programming
    Replies: 2
    Last Post: 6th April 2009, 08:05
  2. Modifying a line in a QTextEdit
    By elcuco in forum Qt Programming
    Replies: 1
    Last Post: 15th March 2008, 16:50
  3. QTextEdit and Form Feed character
    By gvlaovic in forum Qt Programming
    Replies: 1
    Last Post: 15th September 2007, 12:37
  4. Finidng the pixels for a character in QTextEdit
    By sukanyarn in forum Qt Programming
    Replies: 1
    Last Post: 27th October 2006, 09:56
  5. How to get text of last line only in QTextEdit?
    By rajesh in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2006, 13:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.