[PyQt] Is there a signal that is generated by any change in a QListWidget?

Robert Lummis robert.lummis at gmail.com
Sat Jul 17 17:05:32 BST 2010


I have a program that manages a list using QListWidget. It's patterned
after the one in chapter 5 of Mark Summerfield's book. It has Up,
Down, Sort, Add, Delete, Edit, and Save buttons and also a Count label
showing the length of the list, so whenever there is a change to the
list I need to update the buttons and the Count label. By update the
buttons I mean disable the Up/Down button if the current item is at
the top/bottom respectively, and enable it if is isn't. Note that any
change whatsoever including clicking on an item, clicking on Sort,
clicking on Delete, etc. might require the updating to be done.

I put “doUpdate()” after every place in the code that can possibly
cause a change. That works but it would be nicer if a signal were
generated whenever a change occurred that I could connect to
doUpdate(). The documentation for QListWidget only describes signals
for particular kinds of changes. Is there an inherited signal that
does what I want?  Or some other nice way to do it? I find it hard to
search for inherited properties.

-- 
Robert Lummis


More information about the PyQt mailing list