[Qt-interest] QSqlTableModel Modify row error?
Bill King
bill.king at nokia.com
Mon Jul 13 05:35:55 CEST 2009
ext Israel Brewster wrote:
> I am running into some difficulty using QSqlTableModel when a sql
> record contains null values. Specifically, changes made to the record
> are not saved to the database. I have attached a basic test case,
> using QTest, that illustrates the issue. The problem occurs in the
> following situation:
>
> 1) A SQL record is created and saved to a database containing one or
> more NULL columns - in the test case attached, there are three columns
> in the database, and only the first one is populated.
> 2) A QSqlTableModel is set up that retrieves said record
> 3) The record containing NULL values is modified in the
> QSqlTableModel, and the changes (supposedly) saved back to the database
> 4) upon next query, we see that the record has not been changed.
>
> On my build machine, running Mac OS X 10.5, Qt 4.5.2, the test case
> fails on the submitAll with a "Parameter count mismatch" On a friends
> machine (Ubuntu Linux 9.04, Qt 4.5.0, pkg version 4.5.0-0ubuntu4.1)
> the submitAll() command works (at least it returns true), but when the
> database is re-queried, the modifications are not there. Either way,
> it appears to be broken. Am I missing something in my code, or is this
> a bug with QSqlTableModel? I wrote about this earlier, but didn't have
> as straight-forward a test case written then. Thanks.
>
> -----------------------------------------------
> Israel Brewster
> Computer Support Technician II
> Frontier Flying Service Inc.
> 5245 Airport Industrial Rd
> Fairbanks, AK 99709
> (907) 450-7250 x293
> -----------------------------------------------
>
Thankyou for the autotest.
Change de07df9001586cc18ae267591359541b7ea494a0 should show up in the
4.5 public gitorious in about 12 hours or so, and will fix it.
--
Bill King, Software Engineer
Qt Software, Nokia Pty Ltd
Brisbane Office
More information about the Qt-interest-old
mailing list