PyQt5 QListWidget – Setting Spacing Between the Items
In this article we will see how we can set the space between the 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. Spacing property holds the space around the items in the layout. This property is the size of the empty space that is padded around an item in the layout. Setting this property when the view is visible will cause the items to be laid out again. By default, this property contains a value of 0.
In order to do this we will use setSpacing method with the list widget object. Syntax : list_widget.setSpacing(n) Argument : It takes integer as argument Return : It returns None
Below is the implementation
Please Login to comment...