I've had to modify (port) code between minor versions like Qt 5.5 to 5.6, sometimes a lot of it like when webkit was dropped. If you are porting from Qt 2, that is like 20 years ago old. It will be a lot of work and you'll need to know Qt decently well.
If you are just having an issue with mixing Qt versions though you can fix that by setting QTDIR (either in your bashrc or everytime in your shell) and potentially having to modify PATH to not point to the old Qt.