【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( ...
随机推荐
- Java程序员必备的一些流程图
Java程序员必备的一些流程图 转自https://juejin.im/post/5d214639e51d4550bf1ae8df 前言: 整理了一些Java基础流程图/架构图,做一下笔记,大家一起学 ...
- Notepad++设置快捷键及外部命令
<NotepadPlus> <InternalCommands> <Shortcut id="41020" Ctrl="no" A ...
- grunt-contrib-compass 编译sass
grunt-contrib-compass的作用是编译sass文件为css.使用该插件需要先安装sass和compass. (1)安装sassgem install sass(2)安装compassg ...
- python中list.sort()与sorted()的区别
list.sort()和sorted()都是python的内置函数,他们都用来对序列进行排序,区别在于 list.sort()是对列表就地(in-place)排序,返回None:sorted()返回排 ...
- Python 面向对象Ⅱ
创建实例对象 实例化类其他编程语言中一http://www.xuanhe.net/般用关键字 new,但是在 Python 中并没有这个关键字,类的实例化类似函数调用方式. 以下使用类的名称 Empl ...
- kubernetes运用
1:kubernetes基本介绍 kubernetes 是一个开源的容器集群管理系统,K8s用于容器化应用程序的部署 扩展和管理,提供容器编排 资源调度 弹性伸缩 部署管理 服务发现等一系列功能. ...
- 删除文件中的 ^M 字符
删除文件中的 ^M 字符 有时候,我们在 Linux 中打开曾在 Win 中编辑过的文件时,会在行尾看到 ^M 字符.虽然,这并不影响什么,但心里面还是有点不痛快.如果想要删除这些 ^M 字符,可以使 ...
- 【Python之路】特别篇--Python线程池
版本一: #!/usr/bin/env python # -*- coding:utf-8 -*- import Queue import threading class ThreadPool(obj ...
- 如何开始使用 Akka
如果你是第一次开始使用 Akka,我们推荐你先运行简单的 Hello World 项目.情况参考 Quickstart Guide 页面中的内容来下载和运行 Hello World 示例程序.上面链 ...
- python学习之路(3)
字符串和编码 因为python最早只支持ASCII编码普通的字符串'ABC'在Python内部都是ASCII编码的.Python提供了ord()和chr()函数,可以把字母和对应的数字相互转换 后来p ...