PyQt5 QListWidget – Checking if Sorting is Enabled or not
In this article we will see how we can check 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 alt, it can be changed with the help of
In order to do this we will use
isSortingEnabledmethod with the list widget object.
Syntax : list_widget.isSortingEnabled()
Argument : It takes no argument
Return : It returns bool
Below is the implementation
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course