How come you are using PQ directly instead of through the QtSql module?

The obvious way to do what you want to do is to emit a signal to the dialog in question as soon as a change takes place.