Issue
How do I get the content from a selection? I have a table and I want to manipulate the selected item by its content.
The table is connect with a selectionModel like this:
self.table.selectionModel().selectionChanged.connect(dosomething)
I get two QItemSelection in the function, the new selection and the old. But I don't know how to extract it.
Solution
Nevermind, figure it out.
To get it I had to use:
QItemSelection.index()[0].data().toPyObject()
I thought it would be easier. If anyone know a more pythonic way, please reply.
Answered By - f.rodrigues
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.