PyQt5 QListWidget – Making Sorting Enabled
In this article we will see how we can set the sorting enabled property 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. This property holds whether sorting is enabled, if this property is true, sorting is enabled for the list, if the property is false, sorting is not enabled. By default it is false.
In order to do this we will use setSortingEnabled method with the list widget object. Syntax : list_widget.setSortingEnabled(True) Argument : It takes bool as argument Return : It returns None
Below is the implementation
My Personal Notes arrow_drop_up
Please Login to comment...