解决qt_creator: this file is not part of any project问题

解决qt_creator: this file is not part of any project问题

利用qt_creator导入已经生成好的ros workspace后,在此src下面添加文件会出现warning:this file is not part of any project 同时,代码在编写的时候会有报错,虽然编译可以正常通过并且代码能够正常运行,但是无法使用qt的代码补全功能。
ROS_WIKI给出了这样的解释
解决qt_creator: this file is not part of any project问题
但是没有给出详细的解决方案,根据本人测试结果,通过重新构建整个项目,即可解决(构建整个项目/ws或者是重新构建ws都不能解决)