they simply change the ui_*.h files
"They" do? Who is they? Mysterious aliens who live inside your computer and change code while you are sleeping?

It is more likely that when you changed Qt versions you didn't re-run qmake or didn't rebuild your entire project to ensure that all of the generated files (like the ui_*.h and moc_*.cpp) were brought into sync with the new Qt version.

you mix different versions of Qt to compile the project
Never, ever mix different versions of the same libraries, especially Qt, when building a project. Not only are you likely to get incompatible #include files, you are almost certain to get a linker that produces a corrupt executable or a runtime that fails because it can't find the DLLs / shared libraries it needs.