且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

QT如何在设置setFixedSize(Form-> size())后将其禁用

更新时间:2023-11-09 08:40:46

setFixedSize()将最小和最大大小设置为相同的值,因此停止调整大小.因此,我相信您只需要通过调用以下命令来重置最小和最大大小:

setFixedSize() sets the min and max sizes to the same values therefore stopping re-sizing. So I believe you just have to reset the minimum and maximum sizes by calling:

setMinimumSize(...);

setMaximumSize(...);

例如,如果您将最小尺寸设置为0,0,将最大尺寸设置为屏幕/父屏幕的尺寸,那么您应该可以使用完全调整大小...

Example if you set minimum size to 0,0 and maximum to the size of your screen / parent then you should have full resizing available to you...