You don't have to remove anything. I build with the --prefix set to /opt/kde2-HEAD which isolates the whole code, then set QTDIR and KDEDIR to point to the correct places. It works like clockwork.
Right here was where I had problems. Qith QTDIR set to qt-1.x I couldn't compile qt-2.x. It died saying it couldn't find qt. With KDEDIR set to KDE2 the KDE packages barfed a lung. I didn't want to be using or firing a script to switch them back and forth all the time. That's why I stripped KDE and Qt-1.x
Well, OK! If your boat's floating that's cool! If you switch KDEDIR or QTDIR in a shell, the whole system won't go down - the change to the envvar is only visible to that shell and whatever you run from it (like a compiler). So I guess you must have changed them at some earlier point to upset the whole system. I have "kde", "kde2" and "kde2-HEAD" scripts which run from kdm to start whichever environment I choose from the login dialog. Each sets up the correct envvars, and the 3 environments work quite happily together. That said, I haven't booted anything other than kde2-HEAD for weeks now.