| Summary: | Suggests to use Q_ENUM when you can't use it | ||
|---|---|---|---|
| Product: | [Developer tools] clazy | Reporter: | Albert Astals Cid <aacid> |
| Component: | general | Assignee: | Unassigned bugs <unassigned-bugs-null> |
| Status: | REPORTED --- | ||
| Severity: | wishlist | CC: | smartins |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
On the other hand since Q_ENUMS(Status); there actually does nothing, i guess what it should say is "your code is terrible, remove that Q_ENUMS or move it inside a QObject" :D |
clazy 1.5 With this sample code clazy will say #include <QObject> enum class Status { U, A, P, R }; Q_ENUMS(Status); int main(int argc, char **argv) { } main.cpp:11:1: warning: Use Q_ENUM instead of Q_ENUMS [-Wclazy-qenums] Q_ENUMS(Status); but you can't use Q_ENUM in this situation since Q_ENUM doesn't work outside of a QObject