Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Qt 类型不完整,无法定义_Qt_User Interface - Fatal编程技术网

Qt 类型不完整,无法定义

Qt 类型不完整,无法定义,qt,user-interface,Qt,User Interface,我与这个错误斗争了两个多小时: error: aggregate 'Ui::UpdaterProgress updaterProgress' has incomplete type and cannot be defined 我在Qt上有一个简单的UI屏幕。使用对话框设置: #include <ui_UpdaterProgress.h> namespace Ui { class UpdaterProgress; } .... Ui::UpdaterProg

我与这个错误斗争了两个多小时:

error: aggregate 'Ui::UpdaterProgress updaterProgress' has incomplete type and cannot be defined
我在Qt上有一个简单的UI屏幕。使用对话框设置:

  #include <ui_UpdaterProgress.h>

  namespace Ui {
  class UpdaterProgress;
  }
  ....
  Ui::UpdaterProgress updaterProgress;
  QDialog updateProgressDialog;
  updaterProgress.setupUi(&updateProgressDialog);

您是否在
中定义了类更新程序??? 在
Ui::UpdaterProgress UpdaterProgress中使用
UpdaterProgress之前,先定义您的
UpdaterProgress

原型设计本身不能告诉任何关于类的信息,这就是不完整类型错误的原因。

ui\u UpdaterProgress.h
应该有定义。如果您不亲自转发声明,会收到什么错误消息?如果您是
#include
ing ui\u UpdaterProgress.h,您不应该需要转发声明。我在使用设计的。当我将UpdaterProgress作为对话框时,它为我自动生成了类,并且它工作了。
error: 'UpdaterProgress' is not a member of 'Ui'
error: expected `;' before 'updaterProgress'
error: 'updaterProgress' was not declared in this scope