On Thu, 21 Jan 2010 13:38:45 +0000, bar tomas <barto...@gmail.com> wrote: > Hi, > > I've created a QDataWidgetMapper that uses a QSqlRelationalTableModel > to edit the records of database table. > I've tried using the signal beforeInsert to do some validation before > the data is submitted to the database but I have a problem > intercepting the signal (the slot method test just never executes). > Here is a snippet of the relevant code: > > self.model = QSqlRelationalTableModel(self) > > self.connect(self.model, SIGNAL("beforeInsert(record)"), self.test) > > > def test(self, record): > print "test" > > Is there something wrong in the way I've declared the connection?
Yes - use the type of the signal argument (ie. QSqlRecord) not its name. Or use the new-style connection API which will do it for you. Phil _______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt