[PyQt] Not sure how to use QSqlRelationalTableModel
IloChab
ilochab at gmail.com
Wed Jul 11 14:33:31 BST 2007
2007/7/10, Mark Summerfield <mark at qtrac.eu>:
>
> On 2007-07-10, IloChab wrote:
> > I'm trying to use QSqlRelationalTableModel to show records on a table
> that
> > will grow at run-time.
> >
> > What I get is that it works fine for records that are already present in
> > sql tables but it doesn't for new lines that I add at run-time using
> > .setData method.
> >
> > I'll attach to this message the original PyQt example about
> > QSqlRelationalTableModel that I modified adding an "addRecord" function
> > that shows the wrong behaviour I'm talking about.
> >
> > So I'd like to know what it the correct way to code that function.
> >
> > Thanks.
> > Ciao.
> > Licia
>
> I haven't tried it, but I think that your problem may solved by adding
>
> model.submitAll()
>
> at the end of your addRecord() method.
>
> If I do that, the line that I was trying to add doesn't show at all,
while in my original code it showed without the foreign keys resolved.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20070711/e7991a43/attachment.html
More information about the PyQt
mailing list