[Qt-interest] QVBoxLayout with 100s of items is hanging
Sean Harmer
sean.harmer at maps-technology.com
Thu Nov 26 13:43:32 CET 2009
Hi,
On Thursday 26 November 2009 12:28:42 Qt Quest wrote:
> One more thing that I want to note is that on the screen only about 30
> lines are being shown in the scrollable layout. Maybe it is possible to
> defer the computations until the items are actually shown when the layout
> is scrolled down?
As I suggested earlier if you use the model/view approach you will get this
for free. Only those items in the view will be queried by the view for their
actual data.
> Maybe it is possible to hasten the display of the layout using fixed sizes?
QTreeView::setUniroformRowHeights( true ) will do this optimisation for you.
> Is this slow performance the destiny of every application with that much of
> GUI controls? Thank you!
Having 1300 rows of widgets is really pushing things too far. Much better to
have one widget designed to show that much data efficiently.
Just try it. Writing a simple table model is really not that hard to do.
You can always come back to the list with questions if you get stuck writing
the model.
Sean
More information about the Qt-interest-old
mailing list