[PyQt] How can I access QTableModel by primary key index

abdelhak mahmoudi abdel_mahm at yahoo.fr
Tue Sep 2 13:45:12 BST 2014


Hello,
In the following code:

row = 3
col = 4
value =  "Hi"
self.myQTableModel.setData(self.myQTableModel.index(row, col), value)

the row parameter of the index() method is not related to the primary key of my table.

What I want, is access to the row where pimaryKeyIndex  = 3


is there a way to have instead:
self.myQTableModel.setData(self.myQTableModel.index(primaryKeyIndex, col), value)            


Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20140902/49211440/attachment.html>


More information about the PyQt mailing list