Qt 应用程序无法正确调整大小

发布于 2024-10-09 06:39:04 字数 452 浏览 0 评论 0原文

我在调整 Qt 制作的 gui 大小时遇到​​问题。
在全屏模式下,它们基本上不会缩放到可用空间。

这就是我所做的。

1。从 Qt Designer 创建了一个 GUI参见此处

2.当我预览它并尝试最大化它时,它的缩放效果很差。当我为我的应用程序使用此生成的代码时,也会发生同样的事情(最大化时它会严重扩展) 参见此处 and here

问题: 我做错了什么? 谢谢。

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.
See here

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)
see here
and here

Question:
What am i doing wrong?
Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

自由如风 2024-10-16 06:39:04

您需要为主窗口设置布局,然后添加间隔符
在主布局中保持事物的良好浮动。

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

草莓酥 2024-10-16 06:39:04

为整个小部件提供网格布局,以便它知道如何调整大小。

Give the whole widget a grid layoutso it knows how to resize.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文