Qt中用代码在指定位置添加spacer
来源:互联网 发布:上海模型店淘宝地址 编辑:程序博客网 时间:2024/04/28 17:17
可以在调用Layouts控件中的insertSpacerItem( QLayout * layout, int stretch );在指定位置添加spacer, 可以调用removeItem( QLayoutItem * item )方法移除spacer
bool QBoxLayout::setStretchFactor ( QLayout * layout, int stretch )
This is an overloaded function.
Sets the stretch factor for the layout layout to stretch and returns true if layout is found in this layout (not including child layouts); otherwise returns false.
void QLayout::removeItem ( QLayoutItem * item )
Removes the layout item item from the layout. It is the caller's responsibility to delete the item.
Notice that item can be a layout (since QLayout inherits QLayoutItem).
See also removeWidget() and addItem().
//部分代码:
if(loginType == FACTORY)
{
ui->horizontalLayout->insertSpacerItem(2, ui->horizontalSpacer_3);
ui->resultRadioButton->setVisible(true);
}
else
{
ui->horizontalLayout->removeItem(ui->horizontalSpacer_3);
ui->resultRadioButton->setVisible(false);
}
- Qt中用代码在指定位置添加spacer
- 在指定位置添加连线
- MFC中用OPENCV如何将图片显示在指定位置?
- MFC中用OPENCV如何将图片显示在指定位置?
- 在指定的位置添加元素
- 在MkMapView中在指定位置添加大头针
- 在MkMapView中在指定位置添加大头针
- 在桌面添加命令行窗口并指定起始位置
- shell 在指定位置给文本添加字符
- 在数据库表的指定位置添加字段
- js 根据ID或者Class在指定位置添加div
- Android 在图片的指定位置添加标记
- dom4j在指定位置添加标签更新标签
- 学习记录-Qt布局中的Spacer使用
- Qt用编程实现Spacer (转)
- Android 在布局中用代码随意添加视图
- 【OpenCV2】MFC中用OPENCV如何将图片显示在指定位置?
- 【OpenCV2】MFC中用OPENCV如何将图片显示在指定位置
- CEO应向软件工程师学习的7个技能
- U盘fedora无法启动
- 第三讲--SQL语句硬解析和软解析
- 常用框架介绍
- Android--ListView的复用优化
- Qt中用代码在指定位置添加spacer
- UI进阶——XMPP即时通讯
- 大数的存储问题,计算1~40所有数的阶乘
- 正则表达式实用总结
- iOS开发-自定义控件的方式及注意
- 会声会影打开出现已停止工作
- 1015. Reversible Primes (20)
- 探究iOS上拉、下拉原理
- 3D电视已死 4K和曲面屏成厂商下一个目标