我有以下用户类:
class MyLine : public QLineEdit
{
Q_OBJECT
Q_ENUMS(Base::LineState)
public:
explicit MyLine (QWidget *parent = 0);
};
我也有包含所有全局枚举的基类:
class Base
{
Q_GADGET
Q_ENUMS(LineState)
public:
// The states for MyLine
enum LineState
{
Empty, Correct, Wrong
};
};
当我编译这段代码时,出现以下错误:undefined reference to "Base::staticMetaObject"
需要做什么?