[Qt-interest] QListView won't repaint DecorationRole on dataChanged()

Josiah Bryan jbryan at productiveconcepts.com
Thu Oct 29 15:51:23 CET 2009


Josiah Bryan wrote:
> Hello, All -
> 
> I've got a custom QAbstractListModel representing a list of "Slides." 
> The model returns both a slide title and a slide "icon" from the data() 
> method for the Qt::DecorationRole. Works fine "normally."
> 
...
> 
> The problem is, once it does render the slide and return the "updated" 
> pixmap, the list view doesnt paint the correct pixmap! It still shows 
> the gray pixmap. However, if I just click on ANY part of the window (not 
> even in the list view), then the list view magically repaints itself. I 
> can see the QListView requesting the decoration role from my model when 
> it should (after I've rendered the "updated" pixmap) - but it never 
> paints the pixmap on the screen!


After investigating further, I'm still not able to successfully repaint 
the list when the icon changes from inside the model. I've tried sending 
custom repaint events, multiple repaint calls, repaint() then update(), 
focus on different widgets, anything I can think of. Still does not 
repaint unless I click the window (anywhere) then it repaints the 
"correct" new icon.

Anybody have ideas?

OT:
(Thanks, also, for all the the responses to the SIGSEGV in QPixmapCache 
in the last half hour - this is OT, but this is a great mailing list. 
This is one of the most open and friendly mailing lists I'm a part of - 
I really enjoy reading everyone's posts. Thanks everyone for your time 
on this list, not just to my inane and troublesome questions, but for 
your help with all the posts. Cheers!)

Cheers!
-josiah




More information about the Qt-interest-old mailing list