Issue
I am using Python and PySide to create a GUI with a dynamic amount of widgets. I am using sizeHint right now to calculate the size of the window. It works pretty well, but the window is a fixed size when generated. I would like the user to be able to be able to adjust the GUI window on a case by case basis after the sizeHint does the initial calculation. Thanks.
#window.setMinimumWidth(1125)
#window.setFixedWidth(740)
#window.setMinimumHeight(800)
#window.setFixedHeight(200)
window.setFixedSize(grid_layout.sizeHint())
window.setFixedWidth(3500)
window.setAttribute(QtCore.Qt.WA_DeleteOnClose)
window.show()
Solution
Do not set fixed size, just set geometry after show()
window.show()
height = grid_layout.sizeHint().height()
width = 3500
geometry = QtCore.QRect(window.pos(), QtCore.QSize(width, height))
window.setGeometry(geometry)
Answered By - mugiseyebrows
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.