PDA

View Full Version : Space problem in QTextEdit



ashukla
10th January 2008, 07:32
Dear All!
I am using the following code for top to bottom char layout ;
txtScrollEdit->setLineWrapMode(QTextEdit::FixedPixelWidth);
txtScrollEdit->setLineWrapColumnOrWidth(QApplication::font().pixe lSize());
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?

user_mail07
11th January 2008, 18:49
Try this one:-
textEdit.setPlainText("H\n" "I\n" "\n" "A\n" "L\n" "L\n");

ashukla
12th January 2008, 04:39
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."

ashukla
23rd January 2008, 08:36
Dear JPN!
May you see & suggest my problem? How a way I solved?
Because I have a need of vertical text editor.

jpn
23rd January 2008, 09:28
You can always implement the whole document layout yourself if nothing else helps.