我无法将整个QDialog
空间用于我的QScrollArea
. 我设置了QSizePolicy
and setWidgetResizeable(true)
,但没有结果。
from PySide6 import QtWidgets, QtCore
from PySide6.QtCore import Qt
import sys
app = QtWidgets.QApplication(sys.argv)
dialog = QtWidgets.QDialog()
scrollArea = QtWidgets.QScrollArea()
scrollArea.setWidgetResizable(True)
scrollArea.setSizePolicy(QtWidgets.QSizePolicy.Policy.Maximum,QtWidgets.QSizePolicy.Policy.Maximum)
layout = QtWidgets.QVBoxLayout()
layout.addWidget(scrollArea, alignment=Qt.AlignCenter)
dialog.setLayout(layout)
dialog.show()
sys.exit(app.exec())
QScrollArea
不想调整为QDialog
整体。