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

Method __init__

QScrollBar/StyleScrollBar.py:24–36  ·  view source on GitHub ↗
(self, parent=None)

Source from the content-addressed store, hash-verified

22class Window(QTextEdit):
23
24 def __init__(self, parent=None):
25 super(Window, self).__init__(parent)
26 self.resize(800, 600)
27 # 设置横向纵向滚动条总是显示
28 self.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
29 self.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
30 with open("Data/ScrollBar.qss", "rb") as fp:
31 content = fp.read()
32 encoding = chardet.detect(content) or {}
33 content = content.decode(encoding.get("encoding") or "utf-8")
34 self.setText(content)
35 # 设置样式
36 self.setStyleSheet(content)
37
38
39if __name__ == "__main__":

Callers

nothing calls this directly

Calls 2

resizeMethod · 0.95
setTextMethod · 0.45

Tested by

no test coverage detected