PyQt5 QListWidget –Adding Extra Scroll Bar to it
In this article we will see how we can add extra scroll bar 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. Adds widget as a scroll bar widget in the location specified by alignment. Scroll bar widgets are shown next to the horizontal or vertical scroll bar, and can be placed on either side of it. If you want the scroll bar widgets to be always visible, set the scrollBarPolicy for the corresponding scroll bar to AlwaysOn.
In order to do this we will use
addScrollBarWidgetmethod with the list widget object.
Syntax : list_widget.addScrollBarWidget(scrollbar, alignment)
Argument : It takes QScrollBar and QAlignment object as argument
Return : It returns None
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