[PyQt] problem with setItemDelegateForColumn and ItemIsUserCheckable

David Boddie david at boddie.org.uk
Fri Jun 8 00:00:24 BST 2007

On Wednesday 06 June 2007 10:00:10 -0500, Brian DeWeese wrote:

> Thanks for your reply.  I was passing a QObject (a QDialog to be exact) as
> the parent to the delegate but I wasn't storing a reference to the delegate
> anywhere so perhaps it was being deleted in some cases.  I added a variable
> to store the reference to the delegate but unfortunately that didn't change
> anything.

I was just checking to see if you had missed that, but it was obvious from
the description of the problem that you hadn't made that mistake.

> I pared down the code to it's bare minimum and included it here. 
> Thanks for looking into the problem.

You're not going to like this, but, when I use the setItemDelegateForColumn()
method instead of setItemDelegate() for the whole model, the code works in
the way you want, for me at least.

However, it doesn't work when the delegate is used for the whole model, so
it might also be interesting to find out why.

I'm using SIP 4.5.2, PyQt 4.1.1 and Qt 4.2.2.


More information about the PyQt mailing list