您如何调试Qt布局问题 [英] How do you debug Qt layout problems

查看:84
本文介绍了您如何调试Qt布局问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个复杂的对话框,里面充满了空白,我无法缩小它.在Designer中,它包含许多组件,这些组件随后被动态隐藏,而另一些组件则被动态添加.我添加了转储大小策略,大小提示和最小大小,但是仍然不知道为什么Qt不会让我将其拖小.

I've got a complex dialog, and it is full of whitespace and I can't shrink it. In Designer, it has lots of components that then get dynamically hidden, and a few which are dynamically added. I've added dumping of size policies, size hints, and minimum sizes, but still can't figure out why Qt won't let me drag it smaller.

必须有一些工具或技术来对此进行故障排除.

There must be some tools or techniques for troubleshooting this.

请分享.

推荐答案

我不知道执行此操作的任何工具,但在更改对话框中不同元素的调色板,然后查看是什么比我预期的占用了更多(或更少)的空间,并将我的调查重点放在了这些元素上.

I don't know of any tools for doing this, but I have managed it before by changing the palette of the different elements in the dialog, then looking at what is taking up more (or less) room than I expected, and focusing my investigation on those elements.

从更一般的意义上讲,请确保将对话框设置为非固定大小.那一次也伤了我.

In a more general sense, make sure you've set the dialog to not be a fixed size. That bit me once as well.

这篇关于您如何调试Qt布局问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆