qt中mainwindow中添加布局QGridLayout 没有任何反应。。。

对于mainwindow中某个ui对应的cpp中 要使用
this->centralWidget()->setLayout(layout);//重点!!!

或者
ui->centralWidget->setLayout(layout);

但对于再main.cpp中添加时,可以直接setLayout(layout);

添加链接描述

其他例程 https://blog.csdn.net/hyongilfmmm/article/details/83029184

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章