PyQt5 QListWidget – Getting Spacing Between the Items
In this article we will see how we can get 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 although it can be changed with the help of setSpacing method.
In order to do this we will use spacing method with the list widget object. Syntax : list_widget.spacing() Argument : It takes no argument Return : It returns integer
Below is the implementation
Please Login to comment...