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

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