Results 1 to 5 of 5

Thread: Space problem in QTextEdit

  1. #1
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    8
    Thanked 14 Times in 14 Posts

    Default Space problem in QTextEdit

    Dear All!
    I am using the following code for top to bottom char layout ;
    Qt Code:
    1. txtScrollEdit->setLineWrapMode(QTextEdit::FixedPixelWidth);
    2. txtScrollEdit->setLineWrapColumnOrWidth(QApplication::font().pixelSize());
    To copy to clipboard, switch view to plain text mode 
    It displays a text like first attachments however I insert a space between HI and ALL.
    I want the output like second attachmnts.
    What should I do for that?
    Attached Images Attached Images
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  2. #2
    Join Date
    Jan 2007
    Posts
    92
    Thanks
    14
    Thanked 1 Time in 1 Post

    Default Re: Space problem in QTextEdit

    Try this one:-
    textEdit.setPlainText("H\n" "I\n" "\n" "A\n" "L\n" "L\n");
    Attached Images Attached Images

  3. #3
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    8
    Thanked 14 Times in 14 Posts

    Default Re: Space problem in QTextEdit

    Quote Originally Posted by user_mail07 View Post
    Try this one:-
    textEdit.setPlainText("H\n" "I\n" "\n" "A\n" "L\n" "L\n");
    Dear Responder!
    It's work well; but not well for me in this situation. It can be implemented in many ways as you suggested. But the problem is, "why space character doesn't supported in setLineWrapMode(QTextEdit::FixedPixelWidth) in QTextEdit."
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  4. #4
    Join Date
    Aug 2007
    Location
    Gorakhpur, India
    Posts
    254
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    8
    Thanked 14 Times in 14 Posts

    Default Re: Space problem in QTextEdit

    Dear JPN!
    May you see & suggest my problem? How a way I solved?
    Because I have a need of vertical text editor.
    Anurag Shukla
    A man who never makes mistake is the man who never does anything! Theodre Rosvelt!

  5. #5
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts

    Default Re: Space problem in QTextEdit

    You can always implement the whole document layout yourself if nothing else helps.
    J-P Nurmi

Similar Threads

  1. Problem pasting text into a QTextEdit
    By Spockmeat in forum Qt Programming
    Replies: 8
    Last Post: 14th March 2009, 14:36
  2. repaint problem in QTextEdit
    By kennyxing in forum Qt Programming
    Replies: 2
    Last Post: 10th November 2006, 08:49
  3. space between lines in QTextEdit
    By Lele in forum Qt Programming
    Replies: 2
    Last Post: 19th September 2006, 13:05
  4. QTextEdit problem
    By vijay anandh in forum Qt Programming
    Replies: 1
    Last Post: 14th July 2006, 11:56
  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
  •  
Qt is a trademark of The Qt Company.