Chechen Itza
Chechen Itza

Reputation: 141

Making custom QProgressBar

I'm getting the undefined reference to vtable for CustomProgressBar' error when trying to launch following code:
customprogressbar.h

#ifndef CUSTOMPROGRESSBAR_H
#define CUSTOMPROGRESSBAR_H
#include <QProgressBar>
#include "task.h"

class CustomProgressBar : public QProgressBar
{
Q_OBJECT
public:
    CustomProgressBar(DayTask, QWidget* parent = 0);
protected:
    void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;

private:
    DayTask task;
};

#endif // CUSTOMPROGRESSBAR_H

customprogressbar.cpp

#include "customprogressbar.h"
#include <QPainter>

CustomProgressBar::CustomProgressBar(DayTask task, QWidget* parent) :
    task{task},
    QProgressBar(parent)
{

}
//paintevent

What could cause the problem?

Upvotes: 0

Views: 295

Answers (1)

And-y
And-y

Reputation: 66

Maybe moc (meta object compiler) is not being run for your header? Anyway, it's duplicate for this question

Upvotes: 1

Related Questions