1. QHBoxLayout, QVBoxLayout实现

https://blog.csdn.net/qq_19004627/article/details/79751427


  .setMargin(int);  //可以设置左、上、右、下的外边距,设置之后,他们的外边距是相同的。

    Qt垂直布局和水平布局


  .setContentsMargins(int left, int top, int right, int bottom);  //与其功能相同,但是可以将左、上、右、下的外边距设置为不同的值。

    Qt垂直布局和水平布局


   .setContentsMargins(const QMargins &margins);   // 设置外边距(同上)

   .setSpacing(int);    //间距设置

    Qt垂直布局和水平布局


    . addStretch();添加了一个伸缩空间(QSpacerItem)

    Qt垂直布局和水平布局


      .setStretchFactor(QWidget *w, int stretch) , setStretchFactor(QLayout *l, int stretch); //设置控件、布局的拉伸系数

    Qt垂直布局和水平布局



  

相关文章:

  • 2022-02-21
  • 2021-10-05
  • 2021-10-18
  • 2021-09-27
  • 2022-12-23
  • 2021-11-27
  • 2021-09-20
猜你喜欢
  • 2021-07-03
  • 2021-06-06
  • 2022-01-02
  • 2021-11-30
  • 2022-01-15
  • 2022-02-08
相关资源
相似解决方案