I do have a QTableView widget with QtGui.QTableView.SelectRows behaviour.
- How can I get the current selected row?
- Can I get a specific column from that row back, and not only the id of the row?
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
QTableView inherits signals from QAbstractItemView. To get current selected row you have to connect your slots to one of
EDIT1: QModelIndex has methods
row()andcolumn()to know exactly which cell has been clicked/selected.If you are new to Qt/PyQt , You might want to see how to use signals and slots.
EDIT2: If you want to get indexes from the widget itself