[Qt] QLCLAbstractScrollArea implementation

zeljko zeljko at holobit.net
Mon Oct 8 14:47:14 CEST 2007


Hi,

Well, as of bindings 1.53  we have everything to customize our paintings on 
viewport, but seem that it doesn't work as expected.
Test case:
TStringGrid on Form with Align=alClient, filled with 500 rows - 5 cols, each 
contains text Col=XX Row=YY , so very simple.
TStringGrid options are: DrawFocusSelected & SelectRow (so it is used for 
scrolling some data).
So I'll try to show here cca CPU usage measurements while scrolling stringgrid 
from top to bottom (or vice versa) with VK_UP or VK_DOWN keys.
1.gtk1 lcl around 3%.
2.gtk2 lcl around 35%. (looks also too much for me).
3.qt4 lcl > 60% ?!?!?!
4.qt2CLX around 3%
5.qt3CLX around 5% 

This measurements & behaviour of viewport definitelly doesn't smell good.
You can see those problems with large texts in TSynEdit, try to scroll it like 
above example and you'll see large amount of CPU has been eaten.

I've tried all possible options with viewport, with attachedEvents or not, 
with Create or CreateFrom , but always same problem. I've also written my own 
abstractScrollArea - QWidget + scrollbars, which looks good but it also eats 
too much cpu (didn't measured but it's definitelly not normal).

I've found that qtwinapi DrawText()  doesn't take into account "count" 
parameter too, but it doesn't help.
DoubleBuffering in LCL + Doublebuffering in qt libs can produce this ?

Any ideas ? What about win32,carbon does it show this problems too ?

zeljko



More information about the Qt mailing list