python - Getting Selected Rows Count in QTableWidget - PyQt -


in python plugin, i'm developing, need retrieve number of selected rows in qtablewidget. can loop through each row of qtablewidget , check them whether selected or not. instead, there straightforward way selected rows count of qtablewidget in pyqt?

something like:

qtablewidget.selectedrowscount()

if want number of rows fully selected (i.e. when clicking on row header):

len(tablewidget.selectionmodel().selectedrows()) 

but if want rows have at least 1 cell selected:

len(set(index.row() index in tablewidget.selectedindexes())) 

Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -