PyQt5 QListWidget – Setting Current Item
In this article we will see how we can set the current item 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 item can be set from the list of item. Unless the selection mode is NoSelection, the item is also selected.
In order to do this we will use
setCurrentItemmethod with the list widget object.
Syntax : list_widget.setCurrentItem(item)
Argument : It takes QListWidgetItem as argument
Return : It returns None
Below is the implementation