Originally Posted by
jpn
Dear JPN!
I am using a format() function
void dlgTextScroller::format()
{
brush.setStyle(Qt::TexturePattern);
format.setForeground(brush);
if (!cursor.hasSelection())
cursor.setCharFormat(format);
txtScrollEdit->setCurrentCharFormat(format);
}
void dlgTextScroller::format()
{
QTextCharFormat format;
QBrush brush(QImage::QImage("rose.jpg"));
brush.setStyle(Qt::TexturePattern);
format.setForeground(brush);
QTextCursor cursor = txtScrollEdit->textCursor();
if (!cursor.hasSelection())
cursor.select(QTextCursor::Document);
cursor.setCharFormat(format);
txtScrollEdit->setCurrentCharFormat(format);
}
To copy to clipboard, switch view to plain text mode
for formatting the txtScrollEdit Text.
then for Animation of formatted text I am using;
scrItem->setDocument(txtScrollEdit->document());
QGraphicsTextItem *scrItem = new QGraphicsTextItem;
scrItem->setDocument(txtScrollEdit->document());
To copy to clipboard, switch view to plain text mode
In this case my text appears as
Hello
world
Hello
world
To copy to clipboard, switch view to plain text mode
How to gain formatted text for animation in one line.
Bookmarks