Qt project c++ error allocation incomplete type

  allocation, c++, qt

I am learning Qt to do a certain project, I found this code online. I want to try it but I get an error "allocation of incomplete type ‘Ui::Paint’" in the .cpp file.

this is the header file

Paint.h

    
#ifndef PAINT_H

#define PAINT_H

#include <QWidget>
#include <QTimer>
#include <QResizeEvent>

#include <paintscene.h>

namespace Ui {
class Paint;

 
}

class Paint : public QWidget
{
Q_OBJECT

public:
{
 .....}

and this is the .cpp file

paint.cpp

 #include "paint.h"
 #include "ui_paint.h"

 Paint::Paint(QWidget *parent) :
 QWidget(parent),
 ui(new Ui::Paint)
 {
     ui->setupUi(this);

     scene = new paintScene();        
     ui->graphicsView->setScene(scene);  

     timer = new QTimer();       
     connect(timer, &QTimer::timeout, this, &Paint::slotTimer);
     timer->start(100);          
}

Thanks for the help

Source: Windows Questions C++

LEAVE A COMMENT