PyQt5 QListWidget – Getting Selection Rectangle Visible Property
In this article we will see how we can get the selection rectangle visible property 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. If this property is true then the selection rectangle is visible; otherwise it will be hidden. It can be set with the help of setSelectionRectVisible method. Note: The selection rectangle will only be visible if the selection mode is in a mode where more than one item can be selected; i.e., it will not draw a selection rectangle if the selection mode is QAbstractItemView.SingleSelection.
In order to do this we will use isSelectionRectVisible method with the list widget object. Syntax : list_widget.isSelectionRectVisible() Argument : It takes no argument Return : It returns bool
Below is the implementation
Please Login to comment...