QStringList AddedAnimations;
void MyAnimatedTextEdit::addAnimation(const QUrl& url, const QString& fileName){ if(!(AddedAnimations.contains(url.toString()))) { QMovie* movie = new QMovie(this); movie->setFileName(fileName); urls.insert(movie, url); connect(movie, SIGNAL(frameChanged(int)), this, SLOT(animate())); movie->start(); AddedAnimations.append(url.toString()); }}
MyAnimatedTextEdit *qw;
QTextDocumentFragment sl=qw->textCursor().selection();QString sts=sl.toHtml();
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><!--StartFragment--><span style=" color:#000000;">123</span><img src="ad.gif" /><span style=" color:#000000;">123</span><!--EndFragment--></p></body></html>
C++ (Qt)setLineWrapColumnOrWidth(lineWrapColumnOrWidth()); // causes reload