PyQt5 QListWidget – Getting Resize Mode Property
In this article we will see how we can get the resize mode property to 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 the items are laid out again when the view is resized. If this property is Adjust, the items will be laid out again when the view is resized. If the value is Fixed, the items will not be laid out when the view is resized. By default, this property is set to Fixed although it can be set with the help of setResizeMode method.
In order to do this we will use resizeMode method with the list widget object. Syntax : list_widget.resizeMode() Argument : It takes no argument Return : It returns resize mode object, but when printed it shows the value associated with it.
Below is the implementation
Please Login to comment...