[Qt-interest] lazy evaluation of QListWidgetItem decorations?

Paul Miller paul at fxtech.com
Wed Jun 9 18:29:33 CEST 2010


I'm using a QListWidget and QListWidgetItems that override data() to 
return a custom DecorationRole. In this case, they are icons, and 
getting them can be expensive.

I have several of these QListWidgets in a QTabWidget, and unfortunately 
the QListWidgets in hidden tabs are still calling data() to get the 
decoration. I only want this to happen on the QListWidgetItems that are 
ACTUALLY visible. It should wait until the user selects one of these 
hidden tabs to actually attempt to get the decoration.

Is it possible to set this up to do this?

I am using Qt 4.5.3.



More information about the Qt-interest-old mailing list