Ensure that Qt4 and Qt5 export their installation prefixes and binaries locations through /etc/profile.d files.