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
#ifndef REGISTERWIZARDPAGE_H
#define REGISTERWIZARDPAGE_H
#include <QWizardPage>
namespace Ui {
class RegisterWizardPage;
}
class RegisterWizardPage : public QWizardPage
{
Q_OBJECT
public:
explicit RegisterWizardPage
(QWidget *parent
= 0);
~RegisterWizardPage();
private:
Ui::RegisterWizardPage *ui;
};
#endif // REGISTERWIZARDPAGE_H
#ifndef REGISTERWIZARDPAGE_H
#define REGISTERWIZARDPAGE_H
#include <QWizardPage>
namespace Ui {
class RegisterWizardPage;
}
class RegisterWizardPage : public QWizardPage
{
Q_OBJECT
public:
explicit RegisterWizardPage(QWidget *parent = 0);
~RegisterWizardPage();
private:
Ui::RegisterWizardPage *ui;
};
#endif // REGISTERWIZARDPAGE_H
To copy to clipboard, switch view to plain text mode
RegisterWizardPage.cpp
#include "registerwizardpage.h"
#include "ui_registerwizardpage.h"
RegisterWizardPage
::RegisterWizardPage(QWidget *parent
) : QWizardPage(parent),
ui(new Ui::RegisterWizardPage)
{
ui->setupUi(this);
}
RegisterWizardPage::~RegisterWizardPage()
{
delete ui;
}
#include "registerwizardpage.h"
#include "ui_registerwizardpage.h"
RegisterWizardPage::RegisterWizardPage(QWidget *parent) :
QWizardPage(parent),
ui(new Ui::RegisterWizardPage)
{
ui->setupUi(this);
}
RegisterWizardPage::~RegisterWizardPage()
{
delete ui;
}
To copy to clipboard, switch view to plain text mode
Bookmarks