void QLayout::setContentsMargins ( int left, int top,
int right, int bottom )

Sets the lefttopright,
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开发】布局控件之间的间距设置的更多相关文章

  1. CAD控件:QT开发使用控件入门

    1. 环境搭建: 3 1.1. 安装Qt 3 1.2. 安装Microsoft Windows SDK的调试包 6 2. QT中使用MxDraw控件 7 1.3. 引入控件 7 3. 打开DWG文件 ...

  2. Qt之QSpacerItem(控件之间的间距不尽相同,可以借助QSpacerItem来设置,并且还可以对QSpacerItem设置QSizePolicy)

    http://blog.csdn.net/u011012932/article/details/51614868

  3. PyQt(Python+Qt)学习随笔:布局控件layoutSpacing属性

    在Qt Designer中布局控件有4个,分别是Vertical Layout(垂直布局).Horizontal Layout(水平布局).Grid Layout(网格布局).Form Layout( ...

  4. qt ui界面控件布局设计

    1.布局控件简介: 水平布局,里面的控件将水平展示,布局器里面的控件大小若没有固定,其大小将随着布局的大小而自动拉伸.可以通过设置其左(layoutLeftMargin).上(layoutTopMar ...

  5. WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用

    WinForm界面开发之布局控件"WeifenLuo.WinFormsUI.Docking"的使用 转自:http://www.cnblogs.com/wuhuacong/arch ...

  6. WPF布局控件与子控件的HorizontalAlignment/VerticalAlignment属性之间的关系

    WPF布局控件与子控件的HorizontalAlignment/VerticalAlignment属性之间的关系: 1.Canvas/WrapPanel控件: 其子控件的HorizontalAlign ...

  7. PyQt(Python+Qt)学习随笔:布局控件layout的layoutSizeConstraint属性不起作用的问题解决办法

    在<PyQt(Python+Qt)学习随笔:布局控件layout的layoutSizeConstraint属性>中介绍layout的layoutSizeConstraint属性后,反复测试 ...

  8. PyQt(Python+Qt)学习随笔:布局控件layout的layoutSizeConstraint属性

    在Qt Designer中布局控件有4个,分别是Vertical Layout(垂直布局).Horizontal Layout(水平布局).Grid Layout(网格布局).Form Layout( ...

  9. PyQt(Python+Qt)学习随笔:布局控件layout的LeftMargin等contentsMargins属性

    在Qt Designer中布局控件有4个,分别是Vertical Layout(垂直布局).Horizontal Layout(水平布局).Grid Layout(网格布局).Form Layout( ...

随机推荐

  1. CSS3动画实现高亮光弧效果,文字和图片(一闪而过)

    前言 好久没有写博客啦,高亮文字和图片一闪而过的特效,用CSS3来写 先看文字吧, 就上代码了 .shadow { /* 背景颜色线性渐变 */ /* 老式写法 */ /* linear为线性渐变,也 ...

  2. Python 正则表达式Ⅲ

    re.match与re.search的区别 re.match只匹配字符串的开始,如果字符串开始https://www.xuanhe.net/不符合正则表达式,则匹配失败,函数返回None:而re.se ...

  3. shell学习——关于shell函数库的使用

    shell函数库的理解: 个人理解,shell函数库实质为一个脚本,脚本内包含了多个函数(函数具有普遍适用性). shell函数库的调用: 通过  . /path/lib/file.lib 或者 so ...

  4. 关于python-selenium-chromedriver提示

    问题一:AttributeError: module 'selenium.webdriver' has no attribute 'Chromedriver' 配置selenium环境时,执行代码 f ...

  5. CSS之咖啡菜单网页设计

    今天记录学习的设计网站首页的咖啡菜单,综合运用所学习的html,css背景,文本,字体,链接,表格,盒子,选择器,定位,以及css3的阴影,圆角边框,2d变换等内容. ㈠咖啡菜单整体样式 运用html ...

  6. UVA 10900 So do you want to be a 2^n-aire?

    #include<bits/stdc++.h> #include<stdio.h> #include<iostream> #include<cmath> ...

  7. STCubeMX软件新建Keil和IAR工程使用步骤:

    STCubeMX软件新建Keil和IAR工程使用步骤:首先是软件下载(也可在我们的百度云下载):1.STCubeMX下载地址:    http://www.stmicroelectronics.co ...

  8. Linux 压缩方式测试

    测试方法 使用 python 的 Faker 第三方包伪造数据,写入文件 test.txt 复制 test.txt 内容为 test2.txt ,将 test2.txt 的内容重定向到 test.tx ...

  9. [CSP-S模拟测试]:分组配对(倍增+二分)

    题目传送门(内部题108) 输入格式 输入文件第一行为两个正整数$n,M$. 接下来两行,第一行为$n$个正整数$a_1\sim a_n$,其中$a_i$表示编号为$i$的男生的实力值:第二行为$n$ ...

  10. vue2.0中watch总结:普通监听和深度监听

    watch:{} 是一个对象,一定要当成对象来用,可监听数据,是vue中数据发生变化进行处理的函数, 它有三个选项 第一个handler:其值是一个回调函数.即监听到变化时应该执行的函数.第二个是de ...