Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
None
-
5.9.2
-
None
Description
When using this kind of header lupdate complain that it can not guess correctly the fully qualified class namespace for the translations:
// Header namespace MyApp { template <typename Model> class ModelHelper; typedef ModelHelper<class BaseProxyModel> ProxyModel; class XYZ : public QObject { Q_OBJECT public: explicit XYZ(QObject *parent = nullptr); }; } // My App // Source using namespace MyApp; XYZ::XYZ(QObject *parent) : QObject(parent) { tr("Hello"); }
changing to this one fix the issue:
// Header namespace MyApp { template <typename Model> class ModelHelper; class BaseProxyModel; typedef ModelHelper<BaseProxyModel> ProxyModel; class XYZ : public QObject { Q_OBJECT public: explicit XYZ(QObject *parent = nullptr); }; } // My App // Source using namespace MyApp; XYZ::XYZ(QObject *parent) : QObject(parent) { tr("Hello"); }
So the guilty line is typedef ModelHelper<class BaseProxyModel> ProxyModel;
Attachments
Issue Links
- duplicates
-
QTBUG-55478 lupdate is confused by "class" within template angle brackets
-
- Closed
-