<br><br><div><span class="gmail_quote">2007/7/10, Mark Summerfield &lt;<a href="mailto:mark@qtrac.eu">mark@qtrac.eu</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 2007-07-10, IloChab wrote:<br>&gt; I&#39;m trying to use&nbsp;&nbsp;QSqlRelationalTableModel to show records on a table that<br>&gt; will grow at run-time.<br>&gt;<br>&gt; What I get is that it works fine for records that are already present in
<br>&gt; sql tables but it doesn&#39;t for new lines that I add at run-time using<br>&gt; .setData method.<br>&gt;<br>&gt; I&#39;ll attach to this message the original PyQt example about<br>&gt; QSqlRelationalTableModel that I modified adding an &quot;addRecord&quot; function
<br>&gt; that shows the wrong behaviour I&#39;m talking about.<br>&gt;<br>&gt; So I&#39;d like to know what it the correct way to code that function.<br>&gt;<br>&gt; Thanks.<br>&gt; Ciao.<br>&gt; Licia<br><br>I haven&#39;t tried it, but I think that your problem may solved by adding
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;model.submitAll()<br><br>at the end of your addRecord() method.<br><br></blockquote></div>If I do that,&nbsp; the line that I was trying to add doesn&#39;t show at all,
while in my original code it showed without the foreign keys&nbsp; resolved.