Hello,
I try to create my own widget based in QWidget. In constructor of the class i have:
Square(QWidget *parent = 0, const char *name = 0, WFlags fl = 0);
Square::Square(QWidget *parent = 0, const char *name = 0, WFlags fl)
: QWidget(parent, name, f)
{
if (!name)
setName("Game");
reset();
underMouse=false;
}
But i see error: ‘WFlags’ has not been declared
Now i remade my code:
class Square : public QWidget
{
Q_OBJECT
public:
Square(QWidget *parent = 0);
};
and in square.cpp:
Square::Square(QWidget *parent)
: QWidget(parent)
{
}
But i see error:
error: undefined reference to `vtable for Square'
error: collect2: ld returned 1 exit status What's wrong? How can i declare constructor of the class based in QWidget?
Thank you.