[PyQt] decorator for QAbstractItemModel::dataChanged()

Zhao Lee redstone-cold at 163.com
Sat Aug 11 05:31:35 BST 2018


The sample code as following 


self.tableView.setModel(self.sqlTableModel)
self.sqlTableModel.dataChanged.connect(self.onDataChanged)


@pyqtSlot(QModelIndex, QModelIndex)  # ,QVector:name 'QVector' is not defined
    def onDataChanged(self):
        print('onDataChanged--------')


each time when I edit a cell in the table view, the QAbstractItemModel::dataChanged() was triggered two times , I guess my decorator for QAbstractItemModel::dataChanged() may be wrong , so what's the right decorator for it ?





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180811/e6ea9e06/attachment.html>


More information about the PyQt mailing list