PyQt5 / PySide2 QTableView how to find out if row is selected and which one in Python?

Question: I have a QTableView in PyQT5 / PySide2 I want to Know if a row is selected (my tableview is set to select by rows) Know which row is selected Thanks Answer: A bit hackishly though: select = tableview.selectionModel() selected = select.selectedRows() if selected:       print(selected[0].row()) but that does it well: selected = select.hasSelection()

We Launched a Pyside Docs Section 🎉

We Launched a Pyside Docs Section 🎉

Hi folks, an announcement! It’s a bit sad to see that PySide Docs are actually Qt examples. The name is cut off from the scene. We’ve started a project devoted to Pyside docs at pythonmembers.club/pyside. We intend to write self-contained snippets to help people out! Mail arj dot python at gmail dot com if you… Continue Reading We Launched a Pyside Docs Section 🎉