你可以使用Coco。这是由Qt团队开发的工具。请参考: https://www.qt.io/blog/quality-assurance/find-unused-functions-c-code-coverage