[PyQt] arbitrary instance attributes on qt widgets?

Wilbert Berendsen wbsoft at xs4all.nl
Mon May 5 20:17:46 BST 2008


Hi, Is this legal?

q = QListBoxText(listbox)
q.bla = 3

this sets a new attribute 'bla' to 3. I could use this to have the listboxitem 
carry some other data.

Or should I subclass QListBoxItem to add such an attribute?

with best regards,
Wilbert Berendsen

-- 
http://www.wilbertberendsen.nl/
"You must be the change you wish to see in the world."
        -- Mahatma Gandhi


More information about the PyQt mailing list