Quantcast
Channel: Jobs
Viewing all articles
Browse latest Browse all 18427

[Solved]Problem with incomplete type and forward declaration trying to add new file to project.

$
0
0
I am trying to add new file to my project, small find dialog but I have a problem I can’t solve. Everything seems OK to me as I compare my header file for find dialog and for main window but anyway I am getting 4 errors 2 times invalid use of incomplete type and 2 times forward declaration. Code is here: find.h #ifndef FIND_H #define FIND_H   #include <QWidget> #include "ui_find.h"   namespace Ui {     class FindDialog;    //here is forward declaration, reported twice }   class FindDialog : public QWidget{     Q_OBJECT   public:     explicit FindDialog(QWidget *parent =0);     ~FindDialog();   private :         Ui::FindDialog* ui;   public slots:   }; #endif // FIND_H find.cpp #include "find.h"   FindDialog::FindDialog(QWidget* parent) :         QWidget(parent),         ui(new Ui::FindDialog)    //here is invalid use of incomplete type Ui::FindDialog {     ui->setupUi(this);             //and so here   } FindDialog::~FindDialog(){     delete ui; } the same way I have it made in mainwindow but class name is MainWindow and it’s public class of QMainWindow, not QWidget and it’s working without any problems. Can someone help me please? Thanks. :)

Viewing all articles
Browse latest Browse all 18427

Trending Articles