Le 29/03/2013 20:52, pdv a écrit :
I didn't know about rowBreakPoint().
At some point I thought about keeping a list of positions, but discarded
the idea somehow. Even with this new code the scrolling is still not
ideal, so anything that could save some more time could be useful.
I'll take a look at rowBreakPoint().

Note that the only parts that need to be fast AFAIU are the row breaking and the row painting. You may need to define a TextMetrics::textWidth that caches results (like singleWidth does, but with a std::map). This has a big cost in terms of memory, but might be a big win in general.

You might want to investigate QTextBoundaryFinder to so the breaking, but I doubt it would really help us, since we have insets in our text.

The important property would be to have the code that detect word separators and line separators in only one place (rowBreakPoint).

JMarc

Reply via email to