Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
Qt Creator 4.2.0, Qt Creator 4.3.1, Qt Creator 4.4.0
-
None
Description
I'm trying to use C++11 and better-enums to get to where I can define an enum and be able to grab the string knowing only the value, and iterate over them. I tried Q_ENUM_NS as well, which only works on 5.8 and above.
Qt Creator does not auto complete or colorize any enum created by better-enums (using the BETTER_ENUMS() macro). Additionally, it shows an "expected a declaration" error after the first line, whether BETTER_ENUMS() is all on one line or split across multiple lines. It compiles and runs, but Qt Creator shows the error.
I encountered the "expected a declaration" error with Q_ENUM_NS as well, but at least the IDE auto completed in that case. However, in some cases, I may be limited to 5.7.1, so I would like to get Qt Creator working better with better-enums.
Posted here is an example project which reproduces the error as of Qt Creator 4.4.0 on Windows and 4.2.0 or 4.3.1 on Linux (raspberry pi running raspbian - stretch or testing, respectively)
https://github.com/ftab/qt-enums-vs-better-enums/
Attached are the screenshots depicting the described issue