问题:在MainWindow中直接添加Layout会无法生效。

解决办法:需要现在MainWindow中添加一个Widget然后再在Widget上添加Layout即可。

    QWidget* widget = new QWidget(this);
    this->setCentralWidget(widget);
    widget->setLayout(layout);

  

相关文章:

  • 2022-12-23
  • 2021-10-02
  • 2021-11-05
  • 2021-11-30
  • 2021-09-17
  • 2021-04-27
  • 2022-12-23
  • 2021-12-18
猜你喜欢
  • 2021-10-02
  • 2021-08-05
  • 2021-09-19
  • 2022-12-23
  • 2021-06-23
  • 2021-11-20
相关资源
相似解决方案