[Qt-interest] QVBoxLayout with 100s of items is hanging

Qt Quest qt.quest at yahoo.com
Wed Dec 2 11:21:49 CET 2009


Hi André,
Please dont apologize, you meant only good, and I appreciate it!
Do you know how can I test for visibility on the viewport of an item in the list? That way I can cache the visible items (30-40 items) and use only them.
Thanks for the effort!




________________________________
From: Andre Somers <andre at familiesomers.nl>
To: Qt-interest <qt-interest at trolltech.com>
Sent: Tue, December 1, 2009 11:03:28 AM
Subject: Re: [Qt-interest] QVBoxLayout with 100s of items is hanging

Hi "Quest",

Qt Quest wrote:
> Hi André,
> ...
> I'm sure we can cut the processing time considerably.
> I'm thinking of reusing the shown widget for all the 100s of lines 
> (e.g. 2 widgets * 30 visible lines = 60 widgets created only once).
> What do you think?
> Thanks!
I agree that it is unfortunate that it works this way, but I guess it 
was never meant to be used for lists the size you use. I never noticed 
it as a problem, because my lists are limited to a dozen or two items. 
Sorry to have lead you down the wrong path for your situation...

I think that it is going to be more trouble than it is worth to try to 
get KWidgetItemDelegate to behave the way you want, but who knows... 
Please let us know if you manage to do this!
What I would do, is try to implement a delegate based on QTextDocument's 
rich text rendering or by looking at the internals of QLabel. The tricky 
part will be getting the hyperlinks to work, I think. Note: I did not 
try this myself!

I think I might try to create such a delegate at one point though, as I 
think it would come in handy more often...

André





_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091202/069cf479/attachment.html 


More information about the Qt-interest-old mailing list