Open LegalizeAdulthood opened 8 years ago
Hi Eugene,
What was the reactions from Clazy's author? I agree that it would be nice to have a new 'qt' category, and clazy has a nice collection of checks. They have some that are not qt specific tho.
There are https://github.com/KDE/clazy which deals with Qt-related stuff. I already suggested authors to port checks to Clang-tidy.
Extended Description
There are a number of checks that are specific to usage of the Qt library.
In the Qt4 library, they provide a Q_FOREACH construct similar to BOOST_FOREACH. Replace iterating loops with Q_FOREACH, like so:
with
It's possible that in Qt5 they have extended this further to allow C++11 range for loops to be used directly on the QStringList and other QList<> types. If so, then normal range-based for loops should be preferred over the Q_FOREACH macro.
There are still many Qt code bases that would benefit from Q_FOREACH however.
It may also be possible to transform loops using Qt's java style iterator classes into Q_FOREACH.