Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.2.3
-
None
-
Windows 10 PC
Description
I just upgraded to Qt 6.2.3 and I'm now getting errors in one of my moc files for a class that uses an enum in one of its slots. The enum is inside of a namespace called enums, and in the moc file the enum part of the namespace name is being removed. This looks very similar to the bug QTBUG-88125 which was apparently fixed in Qt 5.15, but still seems to be a problem in Qt 6. I have attached a small sample project that reproduces the problem.
Class.h
#ifndef CLASS_H #define CLASS_H #include <QObject> namespace enums { enum class Cards { Clubs, Diamonds, Hearts, Spades }; } class Class : public QObject { Q_OBJECT public: Class() {} signals: void cardPicked(enums::Cards card); public slots: void setCard(enums::Cards card) {} }; #endif // CLASS_H
main.cpp
#include <QCoreApplication> #include "Class.h" int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); Class c; QObject::connect(&c, &Class::cardPicked, &c, &Class::setCard); return a.exec(); }
Errors
Attachments
Issue Links
- relates to
-
QTBUG-88125 [REG: 5.12->5.15]Error processing an enumeration type containing the include directive
- Closed