[PyQt] display a widget in a QTableView

Wim Verhavert wim.verhavert at gmail.com
Thu Oct 16 17:50:54 BST 2008


Dear all,

I want to do something in PyQT I have seen many times in other applications:
A QTableView where the last column contains a QProgressbar. Basically
I want to implement some kind of cue where each item is processed
which can take a while. To give some visual feedback I want to display
a progressbar in the last column. This would allow sorting on progress
and such.
I have the book 'Rapid GUI Programming with Python and Qt' by Mark
Summerfield at hand which contains a section about custom delegates. I
have done similar things in the past, but somehow I'm not able to
translate this into the thing I want to do. Is there somebody out
there that could give me a head start?

I think it will need to create a custom delegate and override the
paint method. But how? How do I paint a progressbar? Do I have to do
this from scratch, i.e. filling a part of the cell with a color, or
can I use a QProgressbar? Any suggestions are welcome.

Cheers!

Wim


More information about the PyQt mailing list