Hy all.<br>I use a QTreeView to show a QDomDocument object. Using drag & drop i makes change to the DOM three.<br><br>The issue: when i send the signal to view to update, data goes corrupted, but only in the view. <br>
<br>This is the code:<br><br>def dropEvent(self, event):<br> oggetto=event.source()<br> parent=oggetto.indexAt(event.pos()).parent() ## this manage the ModelIndex of target when drop<br><br> NomeDest=
parent.child(oggetto.indexAt(event.pos()).row(),0).data().toString()<br> DestId=self.getValoreCaratteristica(parent.child(oggetto.indexAt(event.pos()).row(),1).data().toString(),"id") ## a function that parse the node to find the
<span onclick="dr4sdgryt(event)">specified Attributes (in this case "id")</span><br><br> DragTargetElem=self.findNodeByTagNameID(NomeDest,DestId) ## this return the QDomNode specified by his name and his id
<br> targetParent=DragTargetElem.parentNode()<br> targetParent.insertBefore(self.view.startDragModelInd, DragTargetElem) ##change the Dom layout<br><br> oggetto.model().emit(QtCore.SIGNAL("layoutChanged()")) ## HERE, work but treeview
<span onclick="dr4sdgryt(event)">display garbage text</span><br> <br> print DragTargetElem.ownerDocument().toString() ## used to verify the Dom <span onclick="dr4sdgryt(event)">consistence<br><br><br><br>What error? treeview
</span><span onclick="dr4sdgryt(event)">display</span><span onclick="dr4sdgryt(event)"> a Dom without the dragged/dropped node, also the other node is doubled.<br></span>