【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( ...
随机推荐
- centos7 nginx 代理
2019/06/05 15:00:23 [crit] 4332#4332: *1 connect() to 127.0.0.1:8080 failed (13: Permission denied) ...
- mahout从入门到放弃--安装(1)
1.稀里糊涂下载 我的集群是hadoop 2.7.3 ,本来想找到对应的mahout版本,但是没有找到.本着安全原则,mahout最新版本是0.14.0,回退一个版本使用0.13.0 mahout地址 ...
- LightOJ-1027-A Dangerous Maze(概率)
链接: https://vjudge.net/problem/LightOJ-1027#author=634579757 题意: You are in a maze; seeing n doors i ...
- Python&R&Matlab:批量生成变量
在编写程序时,有时我们需要命名相当多的变量,比如x0.x1.x2.....xn,用手一个个打出来是相当麻烦的.那么这时我们就需要批量生成变量了. 解决这个问题的关键在于,'xn'是自动构造出来的字符串 ...
- k8s-for批量拉取国内镜像并做tag标签
kubeadm config images list ##查看所需镜像 如果是1.15 或者是其他就需要改改 又或者是下面的国内的镜像地址不能用了 百度完改改就ok #!/bin/bash im ...
- linux系统装机分区
- json的概念,语法规则,数组,物件结构
主要说一些关于json的简单应用 ㈠概念 JSON(JavaScript Object Notation, JS 对象简谱) 是一种轻量级的数据交换格式. 它基于 ECMAScript (欧洲计算机协 ...
- poj 3623(贪心)
Best Cow Line, Gold Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 6038 Accepted: 20 ...
- Spring Boot教程(二十六)使用Spring Security安全控制
准备工作 首先,构建一个简单的Web工程,以用于后续添加安全控制,也可以用之前Chapter3-1-2做为基础工程.若对如何使用Spring Boot构建Web应用,可以先阅读<Spring B ...
- mysql 将时间戳与日期时间的转换
from_unixtime()是MySQL里的时间函数 mysql>SELECT FROM_UNIXTIME( 1249488000, '%Y%m%d' ) ->20071120 mys ...