【Qt开发】布局控件之间的间距设置
void QLayout::setContentsMargins ( int left, int top,
int right, int bottom )
Sets the left, top, right,
and bottom margins to use around the layout.
By default, QLayout uses the values provided by the style.
On most platforms, the margin is 11 pixels in all directions.
This function was introduced in Qt 4.3.
这个说默认有11像素的间隙。
测试不行。
//hlayout->setContentsMargins(0,0,0,0);
//hlayout->setContentsMargins(QMargins(0,0,0,0));
主要通过setMargin(0) 设置Layout 的外部边界为0
hlayout->addWidget(start);
hlayout->addWidget(settle);
hlayout->addWidget(treatement);
hlayout->addWidget(final);
//hlayout->setStretchFactor(hlayout,0);
hlayout->setMargin(0);
//hlayout->setContentsMargins(0,0,0,0);
//hlayout->setContentsMargins(QMargins(0,0,0,0));
hlayout->setSpacing(0);
//这个设置成功
【Qt开发】布局控件之间的间距设置的更多相关文章
- CAD控件:QT开发使用控件入门
1. 环境搭建: 3 1.1. 安装Qt 3 1.2. 安装Microsoft Windows SDK的调试包 6 2. QT中使用MxDraw控件 7 1.3. 引入控件 7 3. 打开DWG文件 ...
- Qt之QSpacerItem(控件之间的间距不尽相同,可以借助QSpacerItem来设置,并且还可以对QSpacerItem设置QSizePolicy)
http://blog.csdn.net/u011012932/article/details/51614868
- PyQt(Python+Qt)学习随笔:布局控件layoutSpacing属性
在Qt Designer中布局控件有4个,分别是Vertical Layout(垂直布局).Horizontal Layout(水平布局).Grid Layout(网格布局).Form Layout( ...
- qt ui界面控件布局设计
1.布局控件简介: 水平布局,里面的控件将水平展示,布局器里面的控件大小若没有固定,其大小将随着布局的大小而自动拉伸.可以通过设置其左(layoutLeftMargin).上(layoutTopMar ...
- WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用
WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用 转自:http://www.cnblogs.com/wuhuacong/arch ...
- WPF布局控件与子控件的HorizontalAlignment/VerticalAlignment属性之间的关系
WPF布局控件与子控件的HorizontalAlignment/VerticalAlignment属性之间的关系: 1.Canvas/WrapPanel控件: 其子控件的HorizontalAlign ...
- PyQt(Python+Qt)学习随笔:布局控件layout的layoutSizeConstraint属性不起作用的问题解决办法
在<PyQt(Python+Qt)学习随笔:布局控件layout的layoutSizeConstraint属性>中介绍layout的layoutSizeConstraint属性后,反复测试 ...
- PyQt(Python+Qt)学习随笔:布局控件layout的layoutSizeConstraint属性
在Qt Designer中布局控件有4个,分别是Vertical Layout(垂直布局).Horizontal Layout(水平布局).Grid Layout(网格布局).Form Layout( ...
- PyQt(Python+Qt)学习随笔:布局控件layout的LeftMargin等contentsMargins属性
在Qt Designer中布局控件有4个,分别是Vertical Layout(垂直布局).Horizontal Layout(水平布局).Grid Layout(网格布局).Form Layout( ...
随机推荐
- JavaScript基础——JavaScript入门(笔记)
JavaScript入门(笔记) JavaScript是一种轻量级.解释型的Web开发语言,该语言系统不是很庞杂,简单易学.由于所有现代浏览器都已嵌入JavaScript引擎,JavaScript源代 ...
- electron-vue 引入 vue.ant.design报错
ERROR in ./node_modules/ant-design-vue/dist/antd.less (./node_modules/css-loader!./node_modules/less ...
- CF 680D 堆塔
D. Bear and Tower of Cubes time limit per test 2 seconds memory limit per test 256 megabytes input s ...
- TTTTTTTTTTTT CF 653D 送邮递员
链接:给一张n个点m条带权边的有向图,有x个人从起点出发到终点,每个人带的都带相同重量的货物, 规定一条边最多能经过其上权的重量的货物,问最多能带多重的货物? 2 ≤ n ≤ 50, 1 ≤ m ≤ ...
- HGOI20190710 题解
Problem A 游戏 有$n (1 \leq n \leq 5)$个硬币初始以"0"(正面),"1"(反面) $m (1 \leq m \leq m)$种操 ...
- 上一个树形菜单的改进,增添了数据绑定功能而非仅仅的jq特效
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...
- RedisTemplate 用法
Redis 数据结构简介 Redis 可以存储键与5种不同数据结构类型之间的映射,这5种数据结构类型分别为String(字符串).List(列表).Set(集合).Hash(散列)和 Zset(有 ...
- microsoft office 2010 visio激活
office2010 tookit这款绿色的软件进行Visio2010激活 http://jingyan.baidu.com/article/4f34706ecae169e387b56dd1.html
- jQuery 全选和反选demo
前段时间做了一个全选和反选的功能,最近不忙了,做了一个简化版的demo. 全部代码如下: <!DOCTYPE html> <html> <head> <tit ...
- JS给XMLHttpRequest添加filter
function XMLHttpRequestFilter(){ let base = XMLHttpRequest.prototype.open; let filter_list = []; let ...