PDA

View Full Version : Use QScrollArea, QListView or QScrollBar?



niko
12th July 2006, 19:56
I'm currently working on an application that looks like the attaced screenshot.
As allready posted here: http://www.qtcentre.org/forum/f-newbie-4/t-speed-up-adding-widgets-with-setupdatesenabled-2933.html#post16024 i have speed problems, so would like to ask how could i do this best.

My ideas:
- a QScrollArea with all widgets in it (my current solution, kind of slow when adding/removing widgets)
- QListView based (but i have no idea what to do with the graph)
- create only the Widgets that are visible. Using a QScrollBar I would have to implement my own scrolling-code (especially the "smoth-scrolling" like the QScrollArea provides sounds hard to me!)

please help me on this,
thanks, niko

jpn
15th July 2006, 08:27
Try simply decreasing the number of widgets to the minimum. I have sometimes noticed some slow downs when using large sets and/or deep hierarchies of widgets. Even a dummy and simple widget eats resources. What can I say, I have mostly succeeded in optimizing by just dropping out unnecessary widgets. With unnecessary widgets I mean something like labels which stand there just for showing some text and so on. You can use for example existent widget's content margins to draw some text instead of allocating them all as individual label widgets. It is hard, if not impossible, to give any "real" advices just by having looked at the attached picture... :)

niko
17th July 2006, 20:09
thanks for that tipp!
i will rewrite the application and only create the absolute necessary widgets... a bit more complicated than the QScrollArea :D

niko