Qt 应用程序无法正确调整大小
我在调整 Qt 制作的 gui 大小时遇到问题。
在全屏模式下,它们基本上不会缩放到可用空间。
这就是我所做的。
1。从 Qt Designer 创建了一个 GUI。
2.当我预览它并尝试最大化它时,它的缩放效果很差。当我为我的应用程序使用此生成的代码时,也会发生同样的事情(最大化时它会严重扩展)
问题: 我做错了什么? 谢谢。
I am having a problem with resizing my gui's made from Qt.
In full screen basically they don't scale to the available space.
Here is what i did.
1. Created a gui from Qt Designer.
2. When i preview it and try to maximize it, it scales badly. The same thing happens when i use this generated code for my application(it scales badly when maximized)
Question:
What am i doing wrong?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要为主窗口设置布局,然后添加间隔符
在主布局中保持事物的良好浮动。
http://doc.qt.nokia.com/4.7-snapshot/designer -manual.html
http://doc.qt.nokia .com/4.7-snapshot/designer-layouts.html
You need to set a layout for your your main window and then add spacers
in the main layout to keep things floating nicely.
http://doc.qt.nokia.com/4.7-snapshot/designer-manual.html
http://doc.qt.nokia.com/4.7-snapshot/designer-layouts.html
为整个小部件提供网格布局,以便它知道如何调整大小。
Give the whole widget a
grid layout
so it knows how to resize.