如图所示,如何在QGridLayout中排列项目? [英] How to arrange the items in QGridLayout as shown?

查看:256
本文介绍了如图所示,如何在QGridLayout中排列项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

------------  ------
|          |  | 2  |
|          |  |    |
|     1    |  ------
|          |  ------  
|          |  |  3 |
------------  ------

如何像上面那样安排QGridLayout?

我尝试过:

QGridLayout *layout = new QGridLayout();
centralWidget->setLayout (layout);

layout->addWidget (objOne, 0, 0);
layout->addWidget (objTwo, 0, 1);
layout->addWidget (objThree, 1, 1);

但失败了.

推荐答案

检查但是请注意,使用QtDesigner创建所需的布局要容易得多.检查Qt文档页面以获取更多详细信息

Notice however that it is much easier to create the desired layout using QtDesigner. Check this Qt documentation page for more details

这篇关于如图所示,如何在QGridLayout中排列项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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