I am trying to compile an object file, for C++/Qt; but I receive the warning below, stating that there is no “Q_OBJECT” in my code.
Do I miss something? (my CMakeList.txt contains set(CMAKE_AUTOMOC ON))
#pragma once
#include <QObject>
class TestObject : public QObject {
Q_OBJECT
public:
TestObject();
static TestObject *get() {
static auto *handler = new TestObject;
return handler;
}
};
#include "testobject.h"
#include "testobject.moc"
TestObject::TestObject() {
}
AutoMoc warning
---------------
"SRC:/modules/testobject.cpp"
includes the moc file "testobject.moc", but does not contain a Q_OBJECT, Q_GADGET, Q_NAMESPACE, Q_NAMESPACE_EXPORT or Q_GADGET_EXPORT macro.