利用qt designer实现多窗口:

右键 工程名-> 添加新文件 - > qt

qt designer 添加多个窗口,ui->setupUi(this);段错误

为新建 *.ui 文件创建 *.h  *.cpp

右键 工程名-> 添加新文件 - >c++  ->c++ class

qt designer 添加多个窗口,ui->setupUi(this);段错误

类名与刚刚创建的 *ui 相符

qt designer 添加多个窗口,ui->setupUi(this);段错误 

在新建的*.cpp中包含 ui_*.h文件, 并修改构造函数及*.h

qt designer 添加多个窗口,ui->setupUi(this);段错误

自己挖的坑是,没有添加ui->(new Ui::new),导致  ui->setupUi(this);时短错误。

因为一般情况下.ui文件的.h和.cpp都是自动创建的,所以在自己创建时没有在意这个。

qt designer 添加多个窗口,ui->setupUi(this);段错误 

相关文章:

  • 2022-12-23
  • 2021-04-23
  • 2022-02-15
  • 2021-12-13
  • 2021-06-06
  • 2022-12-23
  • 2021-07-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2021-10-04
  • 2021-12-17
  • 2022-12-23
  • 2021-11-30
相关资源
相似解决方案