For Qt4 and earlier, try the following:
nmake confclean
You can then reconfigure and recompile QT.
As noted in the comments, this no longer works in QT 5. This is because the Qt project now uses separate submodules for different parts. If you have a local clone of the Qt git repositories, you can try calling from the main Qt directory:
git submodule foreach --recursive "git clean -dfx"
As indicated here , problems may occur if you have a downloaded source archive. The link that I posted suggests using shadow assembly, so the process of creating a clean configuration is as simple as setting up to create shadow objects in the new destination.
source share