<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif"></div><div class="gmail_extra"><br><div class="gmail_quote">On 11 August 2018 at 05:31, Zhao Lee <span dir="ltr"><<a href="mailto:redstone-cold@163.com" target="_blank">redstone-cold@163.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div><div style="color:rgb(0,0,0);font-family:arial;font-size:14px">The sample code as following </div><div style="color:rgb(0,0,0);font-family:arial;font-size:14px"><br></div><div><span style="background-color:rgb(255,255,255)">self.tableView.setModel(self.<wbr>sqlTableModel)</span></div><div><span style="background-color:rgb(255,255,255)">self.sqlTableModel.<wbr>dataChanged.connect(self.<wbr>onDataChanged)</span></div><div><br></div><div><div><span style="background-color:rgb(255,255,255)">@pyqtSlot(QModelIndex, QModelIndex)  # ,QVector:name 'QVector' is not defined</span></div><div><span style="background-color:rgb(255,255,255)">    def onDataChanged(self):</span></div><div><span style="background-color:rgb(255,255,255)">        print('onDataChanged--------')</span></div></div><div style="color:rgb(0,0,0);font-family:arial;font-size:14px"><br></div><div style="color:rgb(0,0,0);font-family:arial;font-size:14px">each time when I edit a cell in the table view, the QAbstractItemModel::<wbr>dataChanged() was triggered two times , I guess my decorator for QAbstractItemModel::<wbr>dataChanged() may be wrong , so what's the right decorator for it ?</div><div style="color:rgb(0,0,0);font-family:arial;font-size:14px"><br></div><div style="color:rgb(0,0,0);font-family:arial;font-size:14px"><br></div><div style="color:rgb(0,0,0);font-family:arial;font-size:14px"><br></div></div><br><br><span title="neteasefooter"><p> </p></span><br>______________________________<wbr>_________________<br>
PyQt mailing list    <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
<a href="https://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank" rel="noreferrer">https://www.<wbr>riverbankcomputing.com/<wbr>mailman/listinfo/pyqt</a><br></blockquote></div><br><div class="gmail_default" style="font-family:tahoma,sans-serif">I'm a PyQt user but not an expert.  Whether your decorator is right or wrong I cannot see it would make any difference to how often a slot is called.  I presume it's called twice for some other reason.</div><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><span style="font-family:tahoma,sans-serif">Kindest,</span></div><div><span style="font-family:tahoma,sans-serif">Jonathan</span></div></div></div></div></div>
</div></div><div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
<table style="border-top:1px solid #d3d4de">
        <tr>
        <td style="width:55px;padding-top:13px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td>
                <td style="width:470px;padding-top:12px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank" style="color:#4453ea">www.avast.com</a>
                </td>
        </tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div>