-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.9.0, 6.9.1, 6.9.2
-
None
This seems like a new issue in the 6.9 timeframe. Any time there's class with the same name as the enclosing namespace, lupdate reports a missing `Q_OBJECT` macro error even though the class does mention `Q_OBJECT`. Minimal sample code looks like:
#include <QObject> namespace Test { class Test : public QObject { Q_OBJECT public: Test(); }; Test::Test() { setObjectName(tr("Test")); } }
Running lupdate on this produces:
$ ~/Qt/6.9.2/macos/bin/lupdate test.cpp
lupdate warning: no TS files specified. Only diagnostics will be produced.
test.cpp:12: Class 'Test' lacks Q_OBJECT macro
Moving the call to `tr` inline or changing either the class or namespace name avoids the issue.