Bug 474314

Summary: new check: detect use of Q_FOREACH and replace by C++11 for each
Product: [Developer tools] clazy Reporter: gruenich (Christoph GrĂ¼ninger) <foss>
Component: generalAssignee: 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 In:
Sentry Crash Report:

Description gruenich (Christoph GrĂ¼ninger) 2023-09-08 21:10:59 UTC
Qt discouraged the use of the Q_FOREACH macro since Qt 5.7 and suggests switching to C++-11 range-based for loop.

A new check could detect the use of Q_FOREACH. Further, it might be automatically replaced by a suitable C++-11 range-based for loop.

Link to Q_FOREACH documentation: https://doc.qt.io/qt-6/qforeach-proxy.html