[Qt-interest] animated gif icon in a QTableView
Tony Rietwyk
tony.rietwyk at rightsoft.com.au
Tue Sep 7 04:53:45 CEST 2010
> -----Original Message-----
> Sent: Tuesday, 7 September 2010 10:29
>
> > -----Original Message-----
> > Sent: Tuesday, 7 September 2010 10:16
> >
> > Hi,
> >
> > How to put an animated gif icon in a QTableView, using a
> > custom delegate ?
> >
> > I reimplemented paint() function. I'm blocked on which QStyleOption
> > choosing to assign icon to be displayed (I haven't found a
> > QStyleOptionLabel for displaying a QLabel)...
> >
> > Regards,
> > Omar
>
> Hi Omar,
>
> I think this question was asked recently (by you?) with
> example code that
> showed the style being destroyed within the paint method.
> How do you expect
> the animation / progress bar to continue, if the style is destroyed?
>
> Surely your delegate will need to create a persistent widget
> that manages
> the animation for you? Look at the example delegate that creates a
> spin-box, and adapt that for a progress bar, or label with a QMovie.
>
> Tony.
Correcting myself...
I think the delegate widget is only used for editing the cell. I suggest
using QAbstractItemView.setIndexWidget instead of the delegate - assuming
you only have a small number of rows, of course.
Tony.
More information about the Qt-interest-old
mailing list