[PyQt] decorator for QAbstractItemModel::dataChanged()
J Barchan
jnbarchan at gmail.com
Sat Aug 11 10:34:31 BST 2018
On 11 August 2018 at 05:31, Zhao Lee <redstone-cold at 163.com> wrote:
> 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 ?
>
>
>
>
>
>
>
> _______________________________________________
> PyQt mailing list PyQt at riverbankcomputing.com
> https://www.riverbankcomputing.com/mailman/listinfo/pyqt
>
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.
--
Kindest,
Jonathan
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180811/b651dbca/attachment.html>
More information about the PyQt
mailing list