Qt Designer:当布局无限稀薄时,如何在设计器中将小部件添加到布局中? [英] Qt designer: How to add widget to a layout in the designer when the layout appears infinitely thin?

查看:84
本文介绍了Qt Designer:当布局无限稀薄时,如何在设计器中将小部件添加到布局中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Qt Designer,我想将几​​个顶级小部件移动到水平布局中.

I am using Qt Designer, and I would like to move a couple of top-level widgets into a horizontal layout.

我已经将水平布局"对象拖到了表单中.我现在正在尝试将所需的小部件拖到布局中.

I have dragged a "Horizontal Layout" object into the form. I am now attempting to drag the desired widgets into the layout.

不幸的是,新的水平布局"小部件非常薄:

Unfortunately, the new Horizontal Layout widget is infinitely thin:

...,并且我无法将导入进度"标签小部件或进度条小部件拖到新的水平布局小部件中.

... and I cannot drag my "Import Progress" label widget or my progress bar widget into the new horizontal layout widget.

请注意,当我尝试将所需的窗口小部件拖动到新的水平布局窗口小部件上时,Qt Designer在扩展放置区域以使水平窗口小部件可用作放置目标方面没有任何帮助.所以我被卡住了.

Note that when I attempt to drag the desired widgets over the new horizontal layout widget, Qt Designer does not do anything useful for me in terms of expanding the drop region to make the horizontal widget available as a drop target. So I'm stuck.

如何在Qt Designer中将小部件添加到无限薄的布局小部件中?

How do I add widgets to an infinitely-thin layout widget in Qt Designer?

推荐答案

选择布局,然后将小部件拖放到对象检查器"窗格中的相应选定项上.如果您发现很难在实际表单上选择布局,也可以通过对象检查器"窗格选择它.

Select the layout, and then drop the widget onto the corresponding selected item in the Object Inspector pane. If you find it tricky to select the layout on the actual form, you can also select it via the Object Inspector pane.

这篇关于Qt Designer:当布局无限稀薄时,如何在设计器中将小部件添加到布局中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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