Qt4.4 QListView paragraph
Hey there,
I'm using a QListView to display a list of QTextDocument based paragraphs.
Everytime I resize my view I have to call : QAbstractListModel::reset(), to update the paragraph's geometry.
here is my paint delegate content :
Code:
painter->save();
document.setHtml(mText);
document.
setPageSize(QSize(rect.
width(), rect.
height()));
painter->translate(rect.x(), rect.y());
document.documentLayout()->draw(painter, context);
painter->restore();
When resizing my widgets : the view goes blank, until resize is completed.
Is there a way to avoid this ?
Re: Qt QListView paragraph
This solved the problem for the blank flickering.
Now I have another problem :
- I have my QListView inside a QSplitter.
- When I do have 2 paragraph items or so in my view, the display is fine.
- When I do have 10 or so paragraph items the display is laggy when I drag the splitter left or right.
- When resizing the window itself : no problem.
Has anyone experienced that ?
Re: Qt4.4 QListView paragraph
Using my listView I get white flickering.
This happens when I do subsequent reset() operation. Is there a way to avoid QListView blank paiting flickers ?
Re: Qt4.4 QListView paragraph
Yes, don't call reset :) It's very computation intensive. Try using some other approach. The recent versions of the delegate can signal the view that the size hint of an item might have changed.