PyQt5 QListWidget – Getting Current Selected Row
In this article we will see how we can get the current selected row of the QListWidget. QListWidget is a convenience class that provides a list view with a classic item-based interface for adding and removing items. QListWidget uses an internal model to manage each QListWidgetItem in the list. Current row property holds the row of the current item. Depending on the current selection mode, the row may also be selected with the help of setCurrentRow method.
In order to do this we will use currentRow method with the list widget object. Syntax : list_widget.currentRow() Argument : It takes no argument Return : It returns integer
Below is the implementation
My Personal Notes arrow_drop_up
Please Login to comment...