在for循环里创建 widget,比如test类

不能使用 test t;

而要使用 test t = new test();

 

for (i=0;i<=3;i++)
{
QPushButton* p = new QPushButton(t2);
p->setGeometry(i*100,100,100,100);
}

相关文章:

  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
  • 2021-08-01
  • 2021-09-22
  • 2021-05-03
猜你喜欢
  • 2021-08-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
  • 2022-12-23
相关资源
相似解决方案