【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( ...
随机推荐
- LVS+Heartbeat安装部署文档
LVS+Heartbeat安装部署文档 发表回复 所需软件: ipvsadm-1.24-10.x86_64.rpmheartbeat-2.1.3-3.el5.centos.x86_64.rpmhear ...
- Nginx 0.8.x + PHP 5.2.13(FastCGI)搭建胜过Apache十倍的Web服务器
[文章作者:张宴 本文版本:v6.3 最后修改:2010.07.26 转载请注明原文链接:http://blog.zyan.cc/nginx_php_v6/] 前言:本文是我撰写的关于搭建“Nginx ...
- JS 全局作用域和局部作用域
一.作用域 1.什么是作用域(Scope) 通常来说,一段程序代码中所用到的名字不总是有效和可用的,而限定这个名字的可用性的代码范围就是这个名字的作用域. JS作用域:就是代码名字(变量)作用的范围 ...
- 单元测试 Junit
- System limit for number of file watchers reached
https://blog.csdn.net/weixin_43760383/article/details/84326032 sudo xed /etc/sysctl.conf 在最下添加 fs.in ...
- TensorFlow使用记录 (二): 理解tf.nn.conv2d方法
方法定义 tf.nn.conv2d(input, filter, strides, padding, use_cudnn_on_gpu=True, data_format="NHWC&quo ...
- CodeForces 538F A Heap of Heaps
题意 给定一个长度为n的数组A,将它变为一颗k叉树(1 <= k <= n - 1)(堆的形式编号). 问对于每一个k,有多少个节点小于它的父节点. 解题 显然,最初的想法是暴力.因为树的 ...
- Github 已经托管超过 1000 万个项目库
2013 年对 Github 来说是不可思议和富有成效的一年,几天前 Github.com 上托管的项目已经超过 1000 万. 在此之前,首个 100 万项目用了将近 4 年时间,具体是 3 年 8 ...
- for循环遍历对比
1.for(var i=0; i<10; i++):遍历数组 var arr = ['11', '22']; for(var i=0; i<arr.length;i++){ console ...
- Apache配置转发
第一种: LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_htt ...