Qt: clean includes

Written by  on May 20, 2019 

(I’ve decided to follow a more agile workflow: instead of creation a “one post covers the whole topic”-post, to post also updates for each step. Article will be therefore edited while “doing”)

Last week I’ve cleaned Qt-includes for a larger project. Like #include to #include how it should be. With proper indirection, so that the Qt-library handles how and where the class is implemented.
A colleauge raised the question, why not use #include to be even more precise and to see the used module directly (needed for the CMakeLists or qmake).

First step: identify all used Qt-includes

Greps all includes starting with an uppercase Q; then split the result at the “:”; then sort und make it unique

Second step: create a replacement-list and a (python?) script which does this for all .h/.cpp-files
tdb

Category : C++Qt