[Qt-interest] QSqlDatabase lastError method when using QDataWidgetMapper

bar tomas bartomas at gmail.com
Tue Apr 6 16:26:17 CEST 2010


Hi,

I'm trying to use the lastError method of the  QSqlDatabase  class to
retrieve errors from insert statements sent to my database using a
QDataWidgetMapper and a QSqlRelationalTableModel.
Although I know there is an error with one of the insert statements
(violates foreign key constraint and no row is inserted in the
database) when I try to print the error, with lastError  that I call
after the submit method of the QDataWidgetMapper , only an empty
string is returned. Does lastError not work with a QDataWidgetMapper?

Many thanks



More information about the Qt-interest-old mailing list