[Qt-interest] Resizing a QGridLayout

Alexandre Beraud aberaud at infflux.com
Tue Feb 23 09:56:29 CET 2010


Hi,

Take a look at the Flow Layout example: 
http://doc.trolltech.com/4.5/layouts-flowlayout.html
You will need to subclass QLayout but I think that it is the best if you 
are looking for maximum speed.

Regards,

Alex


Isaac Besora a écrit :
> Sorry if this has been answered before. I've been looking through the 
> list and I couldn't find an answer.
> I'm trying to make something like the icon view in the windows 
> explorer that when the window is resized its icons are redistributed.
> To do this I get the width and height in the resize event and check 
> how many columns and rows can be viewed in the current dimensions and 
> then reinsert all the elements to the QGridLayout. 
> The problem with this is that it's slow. It works well when there are 
> just 20 or so elements, but if I put 200 it starts to go slow. 
> Is there any way that the QGridLayout can handle this without having 
> to erase and reinsert all the elements? I think it could be much more 
> efficient if it was something internal.
> Do you guys have any solution?
> Thanks!
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>   


-- 
Alexandre BERAUD
Ingénieur Développement

Infflux - Informatique & Flux
Tel: 01 49 57 92 00 - Fax : 01 49 57 92 01
Mail: aberaud at infflux.com
Visitez notre site :  www.infflux.com




More information about the Qt-interest-old mailing list