问题
I have a QWidget
, the parent class for all my other widgets. In Qt Designer I set width = 600
and height = 400
for the QWidget
. My size Policy is [Fixed, Fixed, 0, 0]
.
But if I start my the application the QWidgets size is at least 2500*400
. How could I fix the size at application start to 600*400
?
回答1:
The size policy on a toplevel layout is meaningless if you don't set the size constraint as well via QLayout::setSizeConstraint
. It is the size constraint that links the layout to the toplevel widget's size.
来源:https://stackoverflow.com/questions/32116583/how-to-fix-the-size-of-my-qt-window