I'm currently using Qt Creator 4.15.2. I tried with creating a new project in the creator, the .h, .cpp, and .ui files are perfectly linked. If I changed anything in the creator, everything is synchronized. When I selected action->Go to slot, it immediately finds everything.

Then I copied the mainwindow.cpp, mainwindow.h and mainwindow.ui files to my own C++ project. My project has lots of other dependencies so it's hard to create this project directly in the creator. I have successfully included QT5 in my project, so, if I don't use the creator but adding everything manually, everything works fine.

I added the ui file to my cmake list, then opened the ui file in Qt creator. When I changed anything in the creator, the ui file is synchronized and the ui_mainwindow.h file is generated. The problem then comes, if I click action->Go to slot, this error pops up:

No documents matching "ui_mainwindow.h" could be found. Rebuilding the project might help.

I have tried every method online but none of them worked. Now if I want to include the actions, I have to manually add them in the ui_mainwindow.h file (in this way, it wouldn't automatically add the actions) or mainwindow.h file, which is tedious. Does anyone have an idea of how this could be solved?

Thank you very much!