Perhaps less elegant than barhory's solution, this is how I handle two versions of qt:
I have qt 3.3.8, for xconfig, and qt 4.4.0 on a separate partition on my machine. I have the QTDIR environment variable set to '/usr/local/qt' and then in that directory I have a soft link to the version of qt that I want to use:
norm /usr/local: l
. . .
lrwxrwxrwx 1 root staff 30 2009-02-27 14:06 qt -> /b11/qt-x11-opensource-src-4.4.0
lrwxrwxrwx 1 root staff 21 2009-02-01 12:24 qt3 -> /b11/qt-x11-free-3.3.8/
lrwxrwxrwx 1 norm staff 30 2008-07-15 16:48 qt4.4 -> /b11/qt-x11-opensource-src-4.4.0
. . .
I program with 4.4.0 so when I need to configure the kernel I do:
norm /usr/local: rm qt
norm /usr/local: cp qt3 qt