Hi to all,
Hope you all will be fine. Actually i wrote a simple class in which i used inheritance. But when i instantiate this class in main() i am getting error
I used the forward declaration and include the parent class header too in my main file but i am still getting the error. Here is my codeinvalid use of incomplete type ‘struct MainScreen'
MainScreen.cppCode:#include <QtGui/QApplication> #include <QPalette> #include "mainwindow.h" #include <QtGui> #include "Helper.h" #include <qgridlayout.h> class MainScreen; int main(int argc, char *argv[]) { MainScreen * m = new MainScreen(); //error }
Please tell me why i am getting this error.Code:#include <QtGui> class MainScreen : public QGridLayout { public: MainScreen() { QToolButton *campaign_btn = new QToolButton(); campaign_btn->setText("Germany"); addWidget(campaign_btn,0,0,0); } };
Thanks




Reply With Quote