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
setSpacingmethod with the list widget object.
Syntax : list_widget.setSpacing(n)
Argument : It takes integer as argument
Return : It returns None
Below is the implementation
- PyQt5 QListWidget – Getting Spacing Between the Items
- PyQt5 QSpinBox - Setting letter spacing
- PyQt5 QSpinBox - Setting word spacing
- PyQt5 QListWidget - Getting Count of Items
- PyQt5 – Add spacing between indicator and Check box
- PyQt5 - How to change the spacing between indicator and text part of Radio Button ?
- PyQt5 QListWidget - Setting Current Selected Row
- PyQt5 QListWidget - Setting Current Item
- PyQt5 QListWidget - Setting Drag Drop Property
- PyQt5 QListWidget - Setting Drop Indicator Property
- PyQt5 QListWidget - Setting Edit Trigger Property
- PyQt5 QListWidget - Setting its Flow
- PyQt5 QListWidget - Setting Layout Mode
- PyQt5 QListWidget - Setting Batch Size
- PyQt5 QListWidget - Setting Movement Property
- PyQt5 QListWidget - Setting Resize Mode Property
- PyQt5 QListWidget - Setting Selection Mode
- PyQt5 QListWidget - Setting Selection Rectangle Visible Property
- PyQt5 QListWidget – Setting Uniform Item Sizes Property
- PyQt5 QListWidget – Setting Word Wrap
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.