Hello,
How can i append a line or word in QTextEdit with append(or another way) without making a new paragraph.I mean;
let's say in QTextEdit we have "Hello":
Hello
I wanna add "world":
will give the result:
but i want:Hello
world
Hello world
Hello,
How can i append a line or word in QTextEdit with append(or another way) without making a new paragraph.I mean;
let's say in QTextEdit we have "Hello":
Hello
I wanna add "world":
will give the result:
but i want:Hello
world
Hello world
Last edited by jpn; 3rd January 2008 at 14:36. Reason: reformatted to look better
Like QTextExit::append() docs say, it appends a new paragraph. Use QTextEdit::moveCursor(QTextCursor::End) and QTextEdit::insertHtml() or QTextEdit::insertPlainText() instead.
J-P Nurmi
Dear JPN!
I am using a format() function
for formatting the txtScrollEdit Text.Qt Code:
void dlgTextScroller::format() { QTextCharFormat format; brush.setStyle(Qt::TexturePattern); format.setForeground(brush); if (!cursor.hasSelection()) cursor.setCharFormat(format); txtScrollEdit->setCurrentCharFormat(format); }To copy to clipboard, switch view to plain text mode
then for Animation of formatted text I am using;
In this case my text appears as How to gain formatted text for animation in one line.Qt Code:
scrItem->setDocument(txtScrollEdit->document());To copy to clipboard, switch view to plain text mode
Anurag Shukla
A man who never makes mistake is the man who never does anything! Theodre Rosvelt!
Dear Sir!
I want to animate txtScrollEdit texture formatted text in
When Iwrite text using with 36 point font size It goes to next line. And thats the reason when I setDocument() using with above scrItem it goes on the next line. However I want to animate formatted texture text as same asQt Code:
scrItem->setDocument(txtScrollEdit->document());To copy to clipboard, switch view to plain text mode
in a single line.Qt Code:
To copy to clipboard, switch view to plain text mode
Anurag Shukla
A man who never makes mistake is the man who never does anything! Theodre Rosvelt!
Have you tried to play with QGraphicsTextItem::setTextWidth()?
J-P Nurmi
Sir!
I am using above but it shows only the first line of QTextEdit; However, I have not inserted any enter in QTextEdit txtScrollEdit.Qt Code:
scrItem->setDocument(txtScrollEdit->document()); scrItem->setTextWidth(-1);To copy to clipboard, switch view to plain text mode
So, What should I do?
Anurag Shukla
A man who never makes mistake is the man who never does anything! Theodre Rosvelt!
Thank you jpn, i ve been looking for that..!
you can use
before theQt Code:
To copy to clipboard, switch view to plain text mode.Qt Code:
scrItem->setDocument(txtScrollEdit->document()); scrItem->setTextWidth(-1);To copy to clipboard, switch view to plain text mode
It sets the document in one line.
Anurag Shukla
A man who never makes mistake is the man who never does anything! Theodre Rosvelt!
Bookmarks