MCPcopy Index your code
hub / github.com/PyQt5/PyQt / setBackground

Method setBackground

QListView/ImageView.py:54–64  ·  view source on GitHub ↗

设置背景颜色 :param color: 背景颜色 :type color: QColor or str or GlobalColor

(self, color)

Source from the content-addressed store, hash-verified

52 self.setPixmap(image)
53
54 def setBackground(self, color):
55 """设置背景颜色
56 :param color: 背景颜色
57 :type color: QColor or str or GlobalColor
58 """
59 if isinstance(color, QColor):
60 self.setBackgroundBrush(color)
61 elif isinstance(color, (str, Qt.GlobalColor)):
62 color = QColor(color)
63 if color.isValid():
64 self.setBackgroundBrush(color)
65
66 def setPixmap(self, pixmap, fitIn=True):
67 """加载图片

Callers 6

__init__Method · 0.95
testMethod · 0.45
testMethod · 0.45
modelviewserver.pyFile · 0.45
refreshInputsMethod · 0.45
refreshBackColorsMethod · 0.45

Calls

no outgoing calls

Tested by 1

testMethod · 0.36