问题描述
我目前有一个表格,以后可能需要重新调整大小.最初,当创建Form(QDialog)时,将调用setFixedSize方法.在某些情况下,以后可能需要调整表格的大小.无论如何,我们可以禁用此方法并从QDialog内部重新启用它吗?
I currently have a form that might need to be resize later on. Initially when the Form(QDialog) is created the setFixedSize Method is called. In certain circumstances later the form might have to be resized. Is there anyway which we could disable this method and re-enable it again from inside the QDialog ?
推荐答案
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...
这篇关于QT如何在设置setFixedSize(Form-> size())后将其禁用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!