I&#39;m new in Qt programming.<br>I&#39;m using Model/View framework to develop an editor for tree structures.<br>It shows tree data on a QTreeView that I link with setModel() to a different QAbstractItemModel<br>for each set of data read from different files.
<br><br>My problem is that on the first time that I call setModel() every thing works fine, but each time I call a new setModel() for a new data-set (without destroing QTreeView but also without doing new connect() to its signals), I get a new duplicate calls to all my connected methods.
<br>To be more clear:<br>I call once<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.widget.connect(self.view, SIGNAL(&quot;clicked(const QModelIndex &amp;)&quot;),<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.OnItemClicked)<br>At the first data-set loaded&nbsp; self.OnItemClicked
 is called only once<br>
At the second data-set loaded&nbsp; self.OnItemClicked is called twice<br>and so on.<br>When I load a new data-set I create a new QAbstractItemModel object with the new data and I call setModel() again on the old QTreeView object without destroing it.
<br><br>What&#39;s wrong in this?<br><br>Thanks in advance for any answer.<br>ciao!<br>Licia<br>
<br>