QABstractScrollArea是滚动区域的低级抽象
案例
from PyQt5.Qt import * import sys app = QApplication(sys.argv) window = QWidget() window.setWindowTitle("QTextEdit父类功能测试") window.resize(500, 500) te = QTextEdit("测试", window) te.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn) # 设置垂直滚动条策略 te.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOn) # 设置水平滚动条策略 window.show() sys.exit(app.exec_())