简体   繁体   English

Qt 5.6-如何将QTreeWidget链接到mainWindow?

[英]Qt 5.6 - How to link QTreeWidget to the mainWindow?

Yop!

So I just started getting in-touch with QT ( being used to VS ) & I want to make a pretty simple form, nothing really "complex"; 所以我刚开始接触QT(习惯于VS),我想做一个非常简单的表格,没有什么“复杂”的东西。

my goal is to setup my widget ( QTreeWidget ) to automatically take the size of MainWindow and update if the user ( me ) resize the form. 我的目标是将我的小部件(QTreeWidget)设置为自动获取MainWindow的大小,并在用户(me)调整表单大小时进行更新。

I know I could do that with some line of code but I'm pretty sure that it actually possible to set with layout using QTDesigner, my question is how can I do that? 我知道我可以用一些代码来做到这一点,但是我很确定实际上可以使用QTDesigner设置布局,我的问题是我该怎么做?

help would be greatly appreciated! 帮助将不胜感激!

Right click on parent form. 右键单击父窗体。 Select "Layout" in context menu. 在上下文菜单中选择“布局”。 If parent form has child widget you can select one of variants from menu drop-down (Grid, Vertical, Horizontal etc.). 如果父表单具有子窗口小部件,则可以从菜单下拉列表中选择一种(网格,垂直,水平等)。 If parent form not has child elements those menu items will be disabled (((. 如果父表单没有子元素,则这些菜单项将被禁用(((。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM