[PyQt] how know when the number of rows change in QTableWidget ?

Paul Du Bois dubois at doublefine.com
Thu Jan 27 02:25:47 GMT 2011


> I want know when the number of rows change in QTableWidget. Is there
any
> signal or event in PyQt for that?

widget.model() will emit rowsInserted/Moved/Removed signals.  You could
try connecting
to those.  See QAbstractItemModel for details.

You may also need to connect to modelReset because not all modifications
to the data may be expressed
in terms of row additions/removals.

If any operations (say a drag/drop) happen to be implemented internally
as a remove followed by an insert
you may find yourself getting a lot of uninteresting signals.

p


More information about the PyQt mailing list