Results 1 to 9 of 9

Thread: Problem pasting text into a QTextEdit

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem pasting text into a QTextEdit

    Quote Originally Posted by Spockmeat View Post
    Same thing happens in QT 4.1.5. Can anyone verify this happens to them quickly? Simple to reproduce, just open up the rich text example SyntaxHighlighter or create a new dialog, stick on a QTextEidt box and hit preview. Then open up a document in firefox, openoffice, or word 2000 on a win2k or xp box, copy a bunch of text and paste it back in the QT program and see if the text is screwed up.
    I've tried pasting something from Firefox to a dialog with QTextEdit and everything looked OK (Qt 4.1.5, windows XP).

  2. #2
    Join Date
    Apr 2006
    Posts
    40
    Thanks
    4
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem pasting text into a QTextEdit

    I just tried 4.0.1 on this machine and it does the same thing.

    Just so you can see what I'm talking about and can try reproducing exactly. I went to wikipedia, and searched for computers. I grabbed the text from the first couple of paragraphs, pasted it into the syntaxhighlighter (just wanted a qtextedit box, same thing happens in any other program for me), and took a screenshot. You can see scattered throughout the image there are spaces missing between some words. This is just so weird, I have no clue at all what could be causing this.
    Attached Images Attached Images

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem pasting text into a QTextEdit

    Quote Originally Posted by Spockmeat View Post
    I have no clue at all what could be causing this.
    Maybe there's something wrong with the encoding or fonts?

    As you can see in the attachment, it works for me.
    Attached Images Attached Images

  4. #4
    Join Date
    Apr 2006
    Posts
    40
    Thanks
    4
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem pasting text into a QTextEdit

    Hum, so it must be something wrong with my version then... just a standard win2000 box, pentiumII based celeron, installed from the executable package.

    I'll try recompiling Qt myself to see if that'll fix it.

  5. #5
    Join Date
    Feb 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem pasting text into a QTextEdit

    Excuse my english)

    I have some problem with Qt 4.4.3.
    I know, that it happens because QMimeData::html(), which is used by QClipboard do not convert line-breaks to spaces, as any browser or rich text editor does.
    I temporary use QString::simplified(), but it isn't a solution at all because of unwanted trimmings.

    Anyone can help?

  6. #6
    Join Date
    Feb 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem pasting text into a QTextEdit

    Quote Originally Posted by crazY View Post
    I have some problem with Qt 4.4.3
    I have the same problem

  7. #7
    Join Date
    Feb 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Problem pasting text into a QTextEdit

    Solved in Qt 4.5

Similar Threads

  1. Unhandled exception in qatomic
    By NewGuy in forum Qt Programming
    Replies: 14
    Last Post: 23rd July 2013, 09:49
  2. 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
  3. setting cursor problem in QTextEdit
    By jyoti kumar in forum Qt Programming
    Replies: 3
    Last Post: 19th May 2006, 08:17
  4. QTextEdit API questions (plain text)
    By Gaspar in forum Qt Programming
    Replies: 4
    Last Post: 16th May 2006, 06:03
  5. Problem with inserting text into QTextEdit
    By xorrr in forum Qt Programming
    Replies: 0
    Last Post: 6th February 2006, 11:45

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.