MCPcopy Create free account
hub / github.com/PyQt5/PyQt / NoColorItemDelegate

Class NoColorItemDelegate

QTreeWidget/ParentNodeForbid.py:23–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21
22
23class NoColorItemDelegate(QStyledItemDelegate):
24
25 def paint(self, painter, option, index):
26 if option.state & QStyle.State_HasFocus:
27 # 取消虚线框
28 option.state = option.state & ~ QStyle.State_HasFocus
29 if option.state & QStyle.State_MouseOver and index.data(Qt.UserRole + 1):
30 # 不显示鼠标悬停颜色
31 option.state = option.state & ~ QStyle.State_MouseOver
32 super(NoColorItemDelegate, self).paint(painter, option, index)
33
34
35class Window(QTreeWidget):

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected