Dear all,

I created a “QWizardPage form class” in my project. I get the following errors from the auto-generated code:

registerwizardpage.cpp: In constructor ‘RegisterWizardPage::RegisterWizardPage(QWid get*)’:

registerwizardpage.cpp:6: error: invalid use of incomplete type ‘struct Ui::RegisterWizardPage’

registerwizardpage.h:7: error: forward declaration of ‘struct Ui::RegisterWizardPage’

registerwizardpage.cpp:8: error: invalid use of incomplete type ‘struct Ui:RegisterWizardPage’

registerwizardpage.h:7: error: forward declaration of ‘struct Ui::RegisterWizardPage’

registerwizardpage.cpp: In destructor ‘virtual RegisterWizardPage::~RegisterWizardPage()’:

registerwizardpage.cpp:13: warning: possible problem detected in invocation of delete operator:

registerwizardpage.cpp:13: warning: invalid use of incomplete type ‘struct Ui::RegisterWizardPage’

registerwizardpage.h:7: warning: forward declaration of ‘struct Ui::RegisterWizardPage’

Any help for resolving this error please.

RegisterWizardPage.h
Qt Code:
  1. #ifndef REGISTERWIZARDPAGE_H
  2. #define REGISTERWIZARDPAGE_H
  3. #include <QWizardPage>
  4.  
  5. namespace Ui {
  6. class RegisterWizardPage;
  7. }
  8.  
  9. class RegisterWizardPage : public QWizardPage
  10. {
  11. Q_OBJECT
  12.  
  13. public:
  14. explicit RegisterWizardPage(QWidget *parent = 0);
  15. ~RegisterWizardPage();
  16.  
  17. private:
  18. Ui::RegisterWizardPage *ui;
  19. };
  20.  
  21. #endif // REGISTERWIZARDPAGE_H
To copy to clipboard, switch view to plain text mode 

RegisterWizardPage.cpp
Qt Code:
  1. #include "registerwizardpage.h"
  2. #include "ui_registerwizardpage.h"
  3.  
  4. RegisterWizardPage::RegisterWizardPage(QWidget *parent) :
  5. QWizardPage(parent),
  6. ui(new Ui::RegisterWizardPage)
  7. {
  8. ui->setupUi(this);
  9. }
  10.  
  11. RegisterWizardPage::~RegisterWizardPage()
  12. {
  13. delete ui;
  14. }
To copy to clipboard, switch view to plain text mode