You should be able to install the QT3 headers and libs in a different location and use environment variables or flags to differentiate. C_INCLUDE_PATH, CPLUS_INCLUDE_PATH and LIBRARY_PATH or CFLAGS=-Ipath/to/qt3/include, CPLUSFLAGS=-lpath/to/qt3/include, LDFLAGS=-Lpath/to/qt3/lib.
Even better if the developers gave this some thought and the defaults are /usr/include/qt4 and /usr/include/qt3 along with adding a suffix to the libraries to differentiate them. eg libqt4.lib and libqt3.lib
I don't have the QT developers kit installed.