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

Method paint

QTreeWidget/ParentNodeForbid.py:25–32  ·  view source on GitHub ↗
(self, painter, option, index)

Source from the content-addressed store, hash-verified

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

nothing calls this directly

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected