Issue
I have a QTreeWidget and I want to remove the blue highlight area from around the Widget itself, not from the selected item (See image).
Solution
I have since found a couple of ways to achieve this, depending on your setup and the desired affect.
Set the size Policy on the tree widget
tree_widget.setFocusPolicy(QtCore.Qt.NoFocus)
This will stop the QTreeWidget taking focus, preventing the blue outline from appearing.
Set the style sheet on the tree widget
tree_widget.setStyleSheet("QTreeView {border: none; outline: 0;}"
This will completely remove the border (which turns blue).
Bonus, remove the blue border from tree widget items
tree_widget.setStyleSheet("QTreeView::item {border: none; outline: 0;}")
Answered By - Adam Sirrelle
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.