<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I actually went ahead and made the changes I needed to move the data
into the model.&nbsp; Instead of just<br>
replacing the data entirely, I have a loop for updating and inserting,
and one for deleting.&nbsp; Updating<br>
existing data works great, adding/removing is where I'm having issues.<br>
<br>
My data is based off ElementTree.&nbsp; The first thing I do is create a
dictionary that maps each element, to<br>
its parent, and its row:<br>
<br>
{<br>
&lt;Element 'g' at 0xf6bfeae8&gt;: (&lt;Element 'payload' at
0xf6bfe8d8&gt;, 0),<br>
&nbsp;&lt;Element 'e' at 0xf6bfe938&gt;: (&lt;Element 'g' at 0xf6bfeae8&gt;,
0), <br>
&lt;Element 'e' at 0xf6bfeb90&gt;: (&lt;Element 'g' at 0xf6bfeae8&gt;,
1), <br>
&lt;Element 'e' at 0xf6bfeba8&gt;: (&lt;Element 'g' at 0xf6bfeae8&gt;,
2), <br>
&lt;Element 'e' at 0xf6bfebc0&gt;: (&lt;Element 'g' at 0xf6bfeae8&gt;,
3)<br>
}<br>
<br>
I can detect if one of these elements is not in the new ElementTree,
but, how do I get the info needed<br>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="qrichtext" content="1">
to call beginRemoveRows( QModelIndex parent, int row, int col).&nbsp; I can
get the row,col no problem, <br>
but how can I get the deleted items parent QModelIndex?<br>
<br>
Matt<br>
<br>
<blockquote cite="mid200611161337.32825.newellm@blur.com" type="cite">
  <pre wrap="">Why not just avoid calling reset?  If you use beginInsertRows, layoutChanged, 
or whatever is needed, then the selection will be maintained automatically.

Matt

_______________________________________________
PyKDE mailing list    <a class="moz-txt-link-abbreviated" href="mailto:PyKDE@mats.imk.fraunhofer.de">PyKDE@mats.imk.fraunhofer.de</a>
<a class="moz-txt-link-freetext" href="http://mats.imk.fraunhofer.de/mailman/listinfo/pykde">http://mats.imk.fraunhofer.de/mailman/listinfo/pykde</a>

  </pre>
</blockquote>
<br>
</body>
</html>