Well looking back at some other threads on a similar issue I decided to use a timer to insert the text in ~100 character chunks.
This fixes the performance issue *yay*
but sadly the html is not rendered properly when passed in with chunks like this, for example list items <li> don't display on their own lines
void ResultBrowser::loadContent()
{
if(!mContent.isEmpty() && mCurrentIndex < mContent.size())
{
if(!mTextCursor)
{
}
//No splitting tags
int size = mChunkSize;
int index = mContent.indexOf("<", mCurrentIndex + mChunkSize);
if(index > 0)
{
size = index - mCurrentIndex;
}
QString tmp
= mContent.
mid(mCurrentIndex, size
);
mTextCursor->insertHtml(tmp);
mCurrentIndex += size;
}
else
{
mLoadTimer->stop();
}
}
void ResultBrowser::loadContent()
{
if(!mContent.isEmpty() && mCurrentIndex < mContent.size())
{
if(!mTextCursor)
{
mTextCursor = new QTextCursor(&mDocument);
}
//No splitting tags
int size = mChunkSize;
int index = mContent.indexOf("<", mCurrentIndex + mChunkSize);
if(index > 0)
{
size = index - mCurrentIndex;
}
QString tmp = mContent.mid(mCurrentIndex, size);
mTextCursor->insertHtml(tmp);
mCurrentIndex += size;
}
else
{
mLoadTimer->stop();
}
}
To copy to clipboard, switch view to plain text mode
Is the display issue something that can be overcome? or is this a flawed tactic all together?
Bookmarks