Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.5.0
-
None
Description
When writing tests for property names in QML, I stumbled on some MOC errors in qmltc-generated code.
It seems that MOC cannot process certain property, setter or getter names in the Q_PROPERTY macro, here some examples:
Q_PROPERTY(int $ WRITE set$ READ $); // this is fine // Q_PROPERTY(int ä WRITE set$ READ $); // main.cpp: error: Parse error at "READ" Q_PROPERTY(int hä WRITE set$ READ $); // this is fine // Q_PROPERTY(int hä2 WRITE setHä READ hä); // error: no member named 'setH' in 'C' // Q_PROPERTY(int hä3 WRITE setA READ ä); // main.cpp: error: Parse error at "READ" // Q_PROPERTY(int ä WRITE setA READ a); // error: Parse error at "WRITE" // Q_PROPERTY(int ä WRITE setÄ READ ä); // error: Parse error at "WRITE" // note: \u00E4 is an unicode escape for "ä" in JS + CPP // Q_PROPERTY(int \u00E4 WRITE set\u00E4 READ \u00E4); // error: Parse error at "\"
See attached project, uncomment each line seperately to see the error in MOC (or in the C++ compiler when compiling the .moc file in some cases).
Attachments
Issue Links
- is required for
-
QTBUG-115123 qmltc: support all property names (like "ä", "_")
- Reported