Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经设置了,
setGeometry(0,0,1280,760); setMaximumSize(1280,760); setMinimumSize(1280,760);
现在,当我打印 size 和 sizeHint 时,我得到了
尺寸:QSize(1280, 760) 尺寸提示:QSize(970, 752)
尺寸:QSize(1280, 760)
尺寸提示:QSize(970, 752)
这是我的应用程序的确切大小,如何将大小和大小精确更改为 1280X760 ?
尺寸提示只是 QLayout 内小部件的推荐尺寸。它不会影响窗口小部件,在您的情况下是您的应用程序窗口。
但是,如果您想获得不同大小的提示,则需要重新实现sizeHint().
sizeHint()
QSize MyAppWindow:sizeHint() const { return QSize(1280, 760); }