zoukankan      html  css  js  c++  java
  • 【Qt开发】布局控件之间的间距设置

    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);
        //这个设置成功
  • 相关阅读:
    Windows XP中万能断点
    c#运算符 ?
    转神秘的程序员
    经典解决“线程间操作无效
    文件上传
    dowload.aspx
    mail
    js 正则
    新年快乐
    DataTable Compute
  • 原文地址:https://www.cnblogs.com/huty/p/8518152.html
Copyright © 2011-2022 走看看