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

Andre Somers andre at familiesomers.nl
Tue Dec 8 14:01:08 CET 2009


Qt Quest wrote:
> 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!
Hi,

If you are interested, I have made a first version of a 
RichTextDelegate. Most important features:
* It supports links. The delegate object has signals just like QLabel 
(linkHovered and linkActivated) that send out the model index of the 
item and the url of the link.
* you can use it together with the Qt::ItemIsUserCheckable flag
* supports using things like stylesheets and images in the HTML 
(embedded in resources, but you can extend that by subclassing)
* performance on my testset seems quite nice

The rendering is done through QTextDocument, so the restrictions in the 
supported HTML subset apply. If you use the delegate on a QListView and 
have uniformItemSizes set, the delegate does a bit of memory management 
by deleting cached QTextObjects periodically.

Code will be released as (L)GPL.

obligatory screenshot:



André

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091208/7d45b88d/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: screenshot.png
Type: image/png
Size: 17790 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091208/7d45b88d/attachment.png 


More information about the Qt-interest-old mailing list